M MY Multiplayer: Wiki
Side
Kind

createElement

Shared

Creates an element of a type the script makes up, with nothing in the world. It goes under the resource's dynamic element root.

element|false createElement(string type [, string id = ""])

Parameters

NameTypeDescription
typestringThe type's name, what getElementType will return.
idstringThe element's ID, the same as setElementID.default ""

Returns

The created element, or false if there is no room for more elements.

The element belongs to the resource that created it and is destroyed when the resource stops.

Example

local zone = createElement("spawnzone", "spawn_grove")
setElementData(zone, "radius", 25)

See also