IsObjectRespawnable

From Multi Theft Auto: Wiki
Revision as of 12:20, 4 September 2024 by FileEX (talk | contribs) (Created page with "__NOTOC__ {{Shared function}} {{New feature/item|3.0161|1.6.0|22708|This function checks if the object has respawn enabled, which can be toggled using toggleObjectRespawn.}} ==Syntax== <syntaxhighlight lang="lua">bool isObjectRespawnable( object theObject )</syntaxhighlight> {{OOP||object:isRespawnable}} ===Required Arguments=== *'''theObject:''' an object element. ===Returns=== Returns true if the object has respawning enabled, false otherwise. ==Examp...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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