Jump to content

moveObject Function using multiple calls


DarkLink

Recommended Posts

Hi there guys, I have some questions about this new function, its very good btw, very smooth *_*

My questions:

1º if I have this script it only executes the first move, i need to make a timer for the second move ? a timer to make the second move start only when the first ends ?

  
addCommandHandler("move", function() 
  
local x, y, z = getElementPosition(wood) 
  
moveObject ( wood, 3000,x+10, y, z+5,0,0,0) 
local x, y, z = getElementPosition(wood) 
moveObject ( wood, 3000,x+5, y, z+7,0,0,0) 
local x, y, z = getElementPosition(wood) 
moveObject ( wood, 3000,x+10, y, z+5,0,0,0) 
 end) 
  

It only executes the first moveObject.

2º Question, its possible to go from position x to position y using a circumference function ?

I know that the circumference function is something like this : (x-a)^2 + (y-b)^2 = r^2

where (a,b) is the center and r is the radius.

I would want to move a object at same X , but making a circumference style move u see ? kinda hard to figure it out :S

Thanks in advance.

Link to comment

1)

Required Arguments in moveObject

* theObject: The object that will be moved.

* time: The time in milliseconds the object will arrive at the destination.

* targetx: The X value of the target position

* targety: The Y value of the target position

* targetz: The Z value of the target position

im not sure what ur trying to do really, but if ur trying to make an object move to one place then up, then back across, you'll need to add timers to each moveObject, since u give the time it takes to move the object already u would just add a timer to each( if thats what ur trying to do )

2) its possible but i dont think u can do it with moveObject, u would need to use setElementPosition and move it manually in onClientRender using a function to calculate the new co-ords.

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