IsObjectRespawnable

From Multi Theft Auto: Wiki
Jump to navigation Jump to search

ADDED/UPDATED IN VERSION 1.6.0 r22708:
This function checks if the object has respawn enabled, which can be toggled using toggleObjectRespawn.

Syntax

bool isObjectRespawnable( object theObject )

OOP Syntax Help! I don't understand this!

Method: object:isRespawnable(...)


Required Arguments

Returns

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

Example

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)

See Also