Jump to content

Moving Objects


Goomba

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...