Jump to content

Move Object on timer


Xeno

Recommended Posts

Hi,

Im in the middle of scripting a UFO that attacks SF airport and im a bit stuck, everthing works accept it doesent move, heres my script so far.

root = getRootElement ()
players = getElementsByType ( "player" )
 
function UFO( player, commandname )
        setElementPosition ( player, -1326, -67, 15 )
        local UFO = createObject ( 17512, -1326, -67, 55, 180, 0, 0 )
        outputChatBox ( "**EVERYONE GET TO SF AIRPORT, IT IS BEING ATTACKED BY UFO'S RUN!**" )
        local X,Y,Z = getElementPosition ( UFOA )
        local xup = -1430
        local yup = 50
        local zup = 55
        local xup1 = 4178
        local yup1 = -1632
        local zup1 = 20
        local xup2 = 4178
        local yup2 = -1632
        local zup2 = 2
        setTimer ( moveObject, 2000, 1, UFOA, 10000, xup, yup, zup )
        setTimer ( moveObject, 4000, 1, UFOA, 10000, xup1, yup1, zup1 )
        setTimer ( moveObject, 7000, 1, UFOA, 10000, xup2, yup2, zup2 )
end
 
addCommandHandler ( "UFO", UFO )

Link to comment

setTimer ( moveObject, 2000, 1, [color=#0040FF]UFOA[/color], 10000, xup, yup, zup )
setTimer ( moveObject, 4000, 1, [color=#0040FF]UFOA[/color], 10000, xup1, yup1, zup1 )
setTimer ( moveObject, 7000, 1, [color=#0040FF]UFOA[/color], 10000, xup2, yup2, zup2 )

shouldn't it be UFO?

if not, tell us what UFOA is..

function cUFO( player, commandname )
setElementPosition ( player, -1326, -67, 15 )
local UFO = createObject ( 17512, -1326, -67, 55, 180, 0, 0 )
outputChatBox ( "**EVERYONE GET TO SF AIRPORT, IT IS BEING ATTACKED BY UFO'S!**",root,255,100,100 )
 
setTimer ( moveObject, 2000, 1, UFO, 10000, -1430, 50, 55 )
setTimer ( moveObject, 12000, 1, UFO, 10000, 4178, -1632, 20 )
setTimer ( moveObject, 22000, 1, UFO, 10000, 4178, -1632, 2 )
end
 
addCommandHandler ( "UFO", cUFO )

Edited by Guest
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...