Jump to content

Object movement [HELP]


Recommended Posts

How can i make the object only open when the player hit the marker

  
function omg_script90() 
  objectairportgate1 = createObject(980, 1002.599609375, -2310.19921875, 14.89999961853, 0, 0, 295.99914550781) 
  objectairportgate1Attach1 = createObject(980, 1002.5999755859, -2310.1999511719, 19.89999961853, 0, 0, 295.99914550781) 
  attachElements(objectairportgate1Attach1, objectairportgate1, 0.00081883260281757, 8.0878380686045e-006, 5, 0, 0, 2.5011104298756e-012) 
  omgMoveobjectairportgate1(1) 
end 
  
function omgMoveobjectairportgate1(point) 
  if point == 1 then 
    moveObject(objectairportgate1, 5000, 1002.5999755859, -2310.1999511719, 20, 0, 0, 0) 
    setTimer(omgMoveobjectairportgate1, 5000+7000, 1, 2) 
  end 
end 
  
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), omg_script90) 
  

But the most part of the subject which i cared about is this

" function omgMoveobjectairportgate1(point)

if point == 1 then

moveObject(objectairportgate1, 5000, 1002.5999755859, -2310.1999511719, 20, 0, 0, 0)

setTimer(omgMoveobjectairportgate1, 5000+7000, 1, 2) "

This is when only the gate move up

And this is when only the same gate move down

elseif point == 2 then

moveObject(objectairportgate1, 5000, 1002.599609375, -2310.19921875, 14.89999961853, 0, 0, 0)

setTimer(omgMoveobjectairportgate1, 5000+7000, 1, 1)

But i don't want it with continuous movement it just go up and down

Up = when the player click on button

Down = when the player cross the gate

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