Jump to content

Move Object on timer


Xeno

Recommended Posts

Posted

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 )

Posted (edited)

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

Powered by Kimsufi©

n-560x95_FFFFFF_FFFFFF_000000_000000.png

ZHP on FacebookZHP on YoutubeSupport us

Posted

tomdrum11, you should notice the edit button ..

yea its possible, there was a canon resource (dont know exact name, search for it) you can use for that

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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