ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. createObject

Function

createObject

Server and clientObjectsIdentical to MTA:SA

Creates an object from a San Andreas model (e.g. 1337 bin, 3095 ramp, 1225 explosive barrel) or a model replaced with engineReplaceModel. Everyone in the same interior and dimension sees it; it stays in place and has collision. With isBreakable = true the game treats it as breakable and it can be smashed.

Syntax

object createObject(int modelid, float x, float y, float z [, float rx = 0, float ry = 0, float rz = 0, bool isBreakable = false])

Arguments

modelidint
Object model ID.
xfloat
X.
yfloat
Y.
zfloat
Z.
rxfloat, optional = 0
Rotation around X (degrees).
ryfloat, optional = 0
Rotation around Y.
rzfloat, optional = 0
Rotation around Z (heading).
isBreakablebool, optional = false
true = breakable object.

Returns

The new object, or false.

Example

local ramp = createObject(1634, 2495, -1660, 13.5, 0, 0, 90)
local barrel = createObject(1225, 2500, -1660, 13.5, 0, 0, 0, true)

See also