Jump to content

I NEED HELP


lucas848

Recommended Posts

I need to make this object move every 5 minutes from side 1 to 2 to 3 to 2 to 1 and so on

 

function createTheGate ()
         myGate1 = createObject ( 3585, 1806.5999755859,1842.5999755859, 7 , 0, 0, 90 )     
end
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate )

function openMyGate ( )
 moveObject ( myGate1, 90000, 1806.5999755859,1842.5999755859,7 )
end
 addCommandHandler("1",openMyGate)


function movingMyGateBack ()
 moveObject ( myGate1, 90000, 1806.5999755859,1059.0999755859,7 )
end
 addCommandHandler("3",movingMyGateBack)

function movingMyGateBal ()
 moveObject ( myGate1, 45000, 1806.5999755859,1475.5,7 )
end
addCommandHandler("2",movingMyGateBal)
 

Link to comment
1 hour ago, Khadeer143 said:

¿Por qué agregaste el comando? Si desea mover la puerta cada 5 segundos, use la función de temporizador y elimine la función de comando 

Compruebe que estas funciones pueden ayudarlo https://wiki.multitheftauto.com/wiki/MoveObject

I put the commands to test, what I mean is that if I put it for time when it is going from 2 to 3 and the 1-2 is activated because it is every 5 minutes I think we should use something that when it is in such a cordenada, move to the next and so, if I use setTime directly does not work, I'm not good at scripting that's why I went here

 

I do not know much but I guess it would be something like that:

if getElementPosition = 1806.5999755859,1842.5999755859, 7 then

moveObject( 5000, 1806.5999755859,1475.5,7)

 

 

1 hour ago, Khadeer143 said:

 

 

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