ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. setElementAttachedOffsets

Function

setElementAttachedOffsets

Server and clientElementsIdentical to MTA:SA

Changes the offset and rotation of an attached element.

Syntax

bool setElementAttachedOffsets(element theElement [, float xPosOffset = 0, float yPosOffset = 0, float zPosOffset = 0, float xRotOffset = 0, float yRotOffset = 0, float zRotOffset = 0])

Arguments

theElementelement
The attached element.
xPosOffsetfloat, optional = 0
X offset.
yPosOffsetfloat, optional = 0
Y offset.
zPosOffsetfloat, optional = 0
Z offset.
xRotOffsetfloat, optional = 0
X rotation.
yRotOffsetfloat, optional = 0
Y rotation.
zRotOffsetfloat, optional = 0
Z rotation.

Returns

true on success.

Example

local angle = 0
setTimer(function()
    angle = (angle + 10) % 360
    setElementAttachedOffsets(light, 0, -0.2, 0.95, 0, 0, angle)
end, 50, 0)

See also