lucas848 Posted December 13, 2017 Share Posted December 13, 2017 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
Storm-Hanma Posted December 14, 2017 Share Posted December 14, 2017 (edited) Why u added command ? If u want to move gate for every 5sec?use timer function and remove the command function Check these functions may help uhttps://wiki.multitheftauto.com/wiki/MoveObject Edited December 14, 2017 by Khadeer143 Link to comment
lucas848 Posted December 14, 2017 Author Share Posted December 14, 2017 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now