ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. toggleObjectRespawn

Function

toggleObjectRespawn

ServerObjectsIdentical to MTA:SA

Turns an object's respawn on or off. When turned on it stores the current position and rotation that respawnObject returns to.

Syntax

bool toggleObjectRespawn(object theObject, bool respawn)

Arguments

theObjectobject
The object.
respawnbool
true = the object can respawn.

Returns

true on success.

Example

local obj = createObject(1225, 0, 0, 3, 0, 0, 0, true)
toggleObjectRespawn(obj, true)

See also