setElementRotation | Multi Theft Auto: Wiki Skip to content

setElementRotation

Client-side
Server-side
Shared

Pair: getElementRotation

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


Sets the rotation of elements according to the world (does not work with players that are on the ground).

Note

This function does not work on colshape .

Note

This function does not work on dummy element .

Tip

New scripts should set conformPedRotation to true when using this function on peds . This will prevent quirky old behaviour.

Syntax

setElementRotation ( )

Code Examples

server
function pedRotate ( )
local rotX, rotY, rotZ = getElementRotation(localPlayer) -- get the local players's rotation
setElementRotation(localPlayer,0,0,rotZ+10,"default",true) -- turn the player 10 degrees clockwise
end
addCommandHandler ( "turn", pedRotate )

See Also

Element Functions