Kelly003 Posted February 11, 2021 Share Posted February 11, 2021 (edited) I have a problem with how to loop and setElementRotation to keep the object rotating. I would like to ask you to send me a ready code how to do it because I am a beginner code: local obj=createObject(1947,191.14917, -107.59645, 1.54682-1) Edited February 11, 2021 by Kelly003 Link to comment
Tekken Posted February 11, 2021 Share Posted February 11, 2021 Rotating x, y or z? You may just need to do like onClientRender roatet object y+1 or something like that. Link to comment
Hydra Posted February 11, 2021 Share Posted February 11, 2021 local obj=createObject(1947,191.14917, -107.59645, 1.54682-1) function d() local orx, ory, orz = getElementRotation(obj) setElementRotation(obj, orx+1, ory, orz) end end addEventHandler("onClientRender", getRootElement(), d) Or use: interpolateBetween() if you want a smooth rotation 1 Link to comment
Scripting Moderators thisdp Posted February 14, 2021 Scripting Moderators Share Posted February 14, 2021 (edited) local obj=createObject(1947,191.14917, -107.59645, 1.54682-1) function d() setElementRotation(obj, 0, 0, (getTickCount()/10)%360) end addEventHandler("onClientRender", getRootElement(), d) For fps ineffective rotation Edited February 14, 2021 by thisdp 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