dimos Posted September 7, 2012 Posted September 7, 2012 https://www.youtube.com/watch?v=BzjB0qgz ... e=youtu.be local gate = createObject ( 971, 1589, -1638.0999755859, 14.800000190735, 0, 0, 180 )state = 0 function gate() if state == 0 then moveObject( gate, 1589, -1638.0999755859, 7.3000001907349) state = 1 else moveObject ( gate, 1589, -1638.0999755859, 14.800000190735) state = 0 end end addCommandHandler( "gate", gate) gate\gate.lua:5: Bad argument @ 'moveObject' [Expected element at argument 1, got function] https://www.youtube.com/watch?v=a6FIJaCm ... e=youtu.be local bar = createObject ( 2920, 1544.6999511719, -1630.8000488281, 13.10000038147, 90, 0, 180 )state = 0 function barrier() if state == 0 then setObjectRotation( bar,0,0,180) state = 1 else setObjectRotation( bar, 90, 0, 180) state = 0 end end addCommandHandler ( "gate", barrier)
Castillo Posted September 7, 2012 Posted September 7, 2012 You named your variable of the object same as the function name. local gate = createObject ( 971, 1589, -1638.0999755859, 14.800000190735, 0, 0, 180 ) state = 0 function moveGate() if state == 0 then moveObject( gate, 1589, -1638.0999755859, 7.3000001907349) state = 1 else moveObject ( gate, 1589, -1638.0999755859, 14.800000190735) state = 0 end end addCommandHandler( "gate", moveGate) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted September 7, 2012 Posted September 7, 2012 You should use moveObject, not setObjectRotation. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
dimos Posted September 7, 2012 Author Posted September 7, 2012 me only need to move up down no change poss
Flaker Posted September 8, 2012 Posted September 8, 2012 me only need to move up down no change poss Try to read description of this func: https://wiki.multitheftauto.com/wiki/MoveObject There is no way to move obj without changing pos.
Jaysds1 Posted September 8, 2012 Posted September 8, 2012 try using setElementRotation only change the z part, the x and y values should stay at 0. example: local z = getPedRotation(localPlayer) setElementRotation(theObject,0,0,z) My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Jaysds1 Posted September 8, 2012 Posted September 8, 2012 ok, if you want to make the object move, use moveObject but if you want the object to turn and not move, then use setElementRotation My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Jaysds1 Posted September 8, 2012 Posted September 8, 2012 np My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
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