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

Function

respawnObject

ServerObjectsIdentical to MTA:SA

Returns an object to the place stored with toggleObjectRespawn(object, true), repairs it and shows it again. Fires onObjectRespawn.

Syntax

bool respawnObject(object theObject)

Arguments

theObjectobject
The object.

Returns

true on success, false when no place was stored.

Example

local barrel = createObject(1225, 0, 0, 3, 0, 0, 0, true)
toggleObjectRespawn(barrel, true)
addEventHandler("onObjectBreak", barrel, function()
    setTimer(respawnObject, 30000, 1, barrel)
end)

See also