Jump to content

Rotate Ped With Mouse


By Narkoz

Recommended Posts

I did it with the functions you said but the ped is spinning so fast how can I slow it down

tiklandiX = 0
a = 180

addEventHandler("onClientCursorMove", getRootElement(),
function(_, _, x, y)
if peds then
if pedCheck == true then
yeniX =  x - tiklandiX
px,py,pz = getElementRotation (peds)
if a > 360 then
a = 0
elseif a < 0 then
a = 0
end
if yeniX >= 0 then
a = a + 1
setElementRotation(peds,0,0,pz + (x/2))
outputChatBox(x)
else
a = a - 1
setElementRotation(peds,0,0,pz + (x/2))
outputChatBox(x)
end
end
end
end)

function addLabelOnClick(button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement)
if (clickedElement) then
pedCheck = true
tiklandiX = absoluteX
else
pedCheck = false
end
end
addEventHandler("onClientClick", root, addLabelOnClick)

Link to comment

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