Jump to content

moving object


Pinda

Recommended Posts

function resource_starts ()
object1 = createObject ( 4729, 463.294220 -1991.257324 6.617176 )
move1_1 ()
end
addEventHandler ( "onResourceStart", getResourceRootElement(), resource_starts )
 
function move1_1 ()
moveObject ( object1, 5000, 463.294220 -1991.257324 10.267131 )
setTimer ( move1_2, 10000, 1 )
end
 
function move1_2 ()
moveObject ( object1, 5000, 463.294220 -1991.257324 6.617176 )
setTimer ( move1_1, 10000, 1 )
end

/debugscript 3 sais : kutbord.lua:2: ')'expected near '6.617176

but i already have ) near 6.617176 ?

Link to comment

in 2-8-13

try do this x,y,z (comma's)

not x y z (here no comma's)

THIS ONE SHOULD WORK (didnt test)

function resource_starts ()
object1 = createObject ( 4729, 463.294220, -1991.257324, 6.617176 )
move1_1 ()
end
addEventHandler ( "onResourceStart", getResourceRootElement(), resource_starts )
 
function move1_1 ()
moveObject ( object1, 5000, 463.294220, -1991.257324, 10.267131 )
setTimer ( move1_2, 10000, 1 )
end
 
function move1_2 ()
moveObject ( object1, 5000, 463.294220, -1991.257324, 6.617176 )
setTimer ( move1_1, 10000, 1 )
end

Link to comment

it works, but i have problems with the rotation cordinats:(

should i get it from the .map file ? i now have 4729, 463.294220, -1991.257324, 6.6171760, 0, 0, 110.007896665118

the map file give other cordinates then ineditor

<object posX="479.228333" posY="-1991.240234" posZ="6.620041" rotX="0" rotY="0" rotZ="110.007896665118" model="4729" id="object6" />

Edited by Guest
Link to comment

well ur coordinates are the same?

change moveobject coordinates to what direction you want it to go

example

x, y, 0

x, y ,-5

(now it goes into the ground)

my answer might not be correct but take a look at youre coordinates, youre problem is there

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