Goomba Posted December 28, 2009 Posted December 28, 2009 Hey, Can anyone show me how to make a moving object. I tried several things I found in the wiki, but can't get it to work. Just need an example please. bb.
Taalasmaa Posted December 28, 2009 Posted December 28, 2009 function gate() myGate = createObject ( 8378, 0, 0, 0 ) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), gate ) function moveIt (thePlayer ) moveObject ( myGate, 3000, newX, newY, newZ ) setTimer ( moveBack, 5000, 1, thePlayer ) end addCommandHandler("myCommand",moveIt) function moveBack () moveObject ( myGate, 3000, oldX, oldY, oldZ ) end There's... http://www.sincitygaming.net - The next generation of gaming! SinCity Gaming | UltiRace 24/7 - 188.165.199.162:22003 SinCity Gaming | Roleplay Gaming - Beta soon! SinCity Gaming | Zombie Mode + - 188.165.199.162:22005 Instead of using ip: 188.165.199.162 you can use: sincitygaming.net
Goomba Posted December 28, 2009 Author Posted December 28, 2009 Thanks for helping, but still haven't got it working. The object does create but it doesn't move. It's on a race map, don't know if that matters. Here's my script: function gate() myGate = createObject ( 18284, 4207.430176, -1787.572388, 75.101517 ) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), gate ) function moveIt (thePlayer ) moveObject ( myGate, 3000, 4207.430176, -1787.572388, 95.101517 ) setTimer ( moveBack, 5000, 1, thePlayer ) end addCommandHandler("myCommand",moveIt) function moveBack () moveObject ( myGate, 3000, 4207.430176, -1787.572388, 75.101517 ) end And this is the line in my meta.xml:
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now