M MY Multiplayer: Wiki
Side
Kind

setElementID

Shared

Gives an element an id (a name), to find it later with getElementByID.

bool setElementID(element element, string id)

Parameters

NameTypeDescription
elementelementThe element.
idstringThe new id.

Returns

true if it was set, false if the element came from the server and the function runs on a client.

Example

local spawn = createElement("spawnpoint")
setElementID(spawn, "lobby")

local found = getElementByID("lobby")

See also