So im pretty new to this whole lua buisness, and the wiki is alittle bit over whelming. at the moment i would like to know how to spawn a actor(if its possible) and also how to spawn one on either red/green team. can anyone help? or is this not possible?
Sun Aug 09, 2009 9:42 pm
Kyred
Joined: Sun May 31, 2009 1:04 am Posts: 308
Re: Lua? spawning stuff
Here's an example on how to make an AHuman.
Code:
local actor = CreateAHuman("Dummy"); actor.Team = 0; --Red team actor.Pos = Vector(0,0); --Will move him to the top right cornor of the scene. MovableMan:AddActor(actor);
Sun Aug 09, 2009 9:47 pm
Valeoncat
Joined: Fri Mar 20, 2009 12:11 am Posts: 16
Re: Lua? spawning stuff
mhm thanks. so vector is the location where they wil be placed?
Sun Aug 09, 2009 9:49 pm
Geti
Joined: Sun Jul 13, 2008 9:57 am Posts: 4886 Location: some compy
Re: Lua? spawning stuff
yes, and it can be relative, for example, if you wanted it to be placed 20 pixels down from whatever was running the script, you could use actor.Pos = self.Pos + Vector(0,20)
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum