Jump to content

Help [OMG] Object Moving Generator


cleverdog32

Recommended Posts

  • 2 weeks later...

Hello , cleverdog32. I don't know if I'm late to post here , but ok..

You can set your object move to specific coordinates using command. For example you type '/movemyobject' and it moves to where do you want. BTW you create the object you want using lua , not map editor.

Hope this piece of code will help you:

function createTheObject () -- function for creating your object 
  
myObject = createObject ( objectmodel , x , y , z , xrotation , yrotation , zrotation)  -- If you haven't rotated the object , put for xyz rotation all to 0.  
-- x , y , z  is the position where you want to create the object 
  
end 
  
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheObject ) 
  
  
  
function moveMyObject( )  -- function for moving your object 
moveObject ( myObject , 2500, x , y , z )  -- 2500 is the time in miliseconds ( how fast will the object move to it's position ) 
end 
addCommandHandler("myobjectmove",moveMyObject)  -- change "myobjectmove" to anything you want. for example:        'abracadabra!'    
  
  
function moveMyObjectBack () -- function for moving your object back 
moveObject ( myObject , 2500, x , y , z ) -- set xyz to original object's position. 
end 
addCommandHandler("myobjectmoveback", moveMyObjectBack) -- change "myobjectmoveback" to anything you want. 

Link to comment
  • 1 month later...

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