createObject
Client
Creates an object that exists on this client only.
Also exists on the server, with its own implementation: createObject
object|false createObject(string model, float x, y, z [, float rx, ry, rz = 0, 0, 0])
Parameters
| Name | Type | Description |
|---|---|---|
| model | string | The model's name, case-insensitive. |
| x, y, z | float | The position in the world. A vec3 also works. |
| rx, ry, rz | float | The rotation in degrees. A vec3 also works.default 0, 0, 0 |
Returns
The created object, or false if it could not be created.
The object goes away when the resource that created it stops.
Example
local barrier = createObject("roadworkbarrier1", 2495.0, -1668.0, 13.0, 0, 0, 90)
setElementFrozen(barrier, true)NoteA model that is neither an object nor a weapon is refused with a debug warning, and the function returns
false.