Goomba Posted December 28, 2009 Share 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. Link to comment
Taalasmaa Posted December 28, 2009 Share 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... Link to comment
Goomba Posted December 28, 2009 Author Share 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: Link to comment
Goomba Posted December 28, 2009 Author Share Posted December 28, 2009 Fixed, thanks for helping anyway Link to comment
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