- Documentation
- Server functions
- respawnObject
Function
respawnObject
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)