getElementSyncer | Multi Theft Auto: Wiki Skip to content

getElementSyncer

Client-side
Server-side
Shared

Pair: setElementSyncer

Manual Review Required

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


This function gets the syncer of an element. The syncer is the player who is in control of the element.

OOP Syntax Help! I don't understand this!

  • Method:element:getSyncer(...)
  • Variable: .syncer

Syntax

element getElementSyncer ( element theElement )
Required Arguments
  • theElement: The element to get the syncer of.

Returns

  • element: value

Returns the element that is the syncer of theElement or false if the element does not have a syncer.

Code Examples

shared

This code will kill the syncer of the first ped created with createPed.

local elementSyncer = getElementSyncer(getElementsByType("ped")[1])
if elementSyncer and getElementType(elementSyncer) == "player" then --Check if its a player and if there is a syncer
killPed(elementSyncer, elementSyncer)
end

See Also

Element Functions