isObjectRespawnable | Multi Theft Auto: Wiki Skip to content

isObjectRespawnable

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function checks if the object has respawn enabled, which can be toggled using toggleObjectRespawn.

OOP Syntax Help! I don't understand this!

  • Method:object:isRespawnable(...)

Syntax

bool isObjectRespawnable ( object theObject )
Required Arguments
  • theObject: an object element.

Returns

  • bool: value

Returns true if the object has respawning enabled, false otherwise.

Code Examples

shared
addCommandHandler('checkobjects', function()
local count = 0
for k,v in ipairs(getElementsByType('object')) do
if (isObjectRespawnable(v)) then
count = count + 1
end
end
outputChatBox(count..' objects on map are respawnable!')
end)