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
| Name | Type | Description |
|---|---|---|
| type | string | The type's name, what getElementType will return. |
| id | string | The 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)