Jump to content

[Help] with a loop and setElementRotation


Recommended Posts

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.596451.54682-1)
Edited by Kelly003
Link to post
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

  • Like 1
Link to post
  • Scripting Moderators
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 by thisdp
Link to post

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