Jump to content

Create, them Move, then Despawn issue.


DazzaJay

Recommended Posts

Basically, here is the script i have

function scriptCreatePlane () 
    airplane = createVehicle ( 577, -943.5, 548.4, 30.0, 0.0, 0.0, 280.0, plane ) 
    moveObject ( airplane, 10000, -1841.2, -345.2, 30.0 ) 
    setTimer (destroyElement, 12000, 1, airPlane) 
end 
  
addCommandHandler ( "plane", scriptCreatePlane ) 

Im sure you can tell what im Trying to do.

Create a Plane, then Move the Plane over 10 seconds, then Destroy the plane after 12.

Problem is, the Plane spawns, then just falls.

No errors are outputted, so i have no idea what its doing. any ideas?

Link to comment

Ok, now a really dumb question, would the vehicleID of the AT400 (577) be the same as say, the modelID?

Well, i tried that and it failed, Error bad Model ID.

Ok, ive had SOME limited success.

I got the plane to Spawn and Not fall by attaching it to an Object like this:

function scriptCreatePlane () 
    airPlane = createObject ( 2469, -943.5, 548.4, 30.0 ) 
    airplane1 = createVehicle ( 577, -943.5, 548.4, 30.0, 0.0, 0.0, 180.0 ) 
    setElementParent ( airplane1, airPlane ) 
    setTimer ( attachElementToElement, 500, 1, airplane1, airPlane, 0, 0, -1 ) 
    setTimer ( moveTimer, 600, 1 ) 
end 
  
function moveTimer () 
    moveObject ( airplane, 10000, -1841.2, -345.2, 30.0 ) 
    setTimer (destroyElement, 12000, 1, airplane) 
end 
  
addCommandHandler ( "plane", scriptCreatePlane ) 

But i get Bad Argument Line 10 (moveObject) just after it spawns.

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...