Ryosuke Posted August 26, 2017 Share Posted August 26, 2017 Hello, I would like to ask for the help to create a system to rotate an object when I hold a certain button , It will only stop after I release objectRotation = 0; objeto = createObject ( 1852,2714,-1756.2700195313,77.559997558594, 0, 0, 0 ) function func () objectRotation = objectRotation + 1.20 setElementRotation(objeto, 0, 0, objectRotation) end function func2 () objectRotation = objectRotation - 1.20 setElementRotation(objeto, 0, 0, objectRotation) end bindKey ( "2", "down", func2 ) bindKey ( "3", "down", func ) Link to comment
Tails Posted August 26, 2017 Share Posted August 26, 2017 Use this addEventHandler("onClientRender", root, function() if getKeyState("2") then objectRotation = objectRotation + 1.20 setElementRotation(objeto, 0, 0, objectRotation) end end) 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