RespawnObject

From Multi Theft Auto: Wiki
Revision as of 12:10, 4 September 2024 by FileEX (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function respawns a specific object.

ADDED/UPDATED IN VERSION 1.6.0 r22708:
This function is now also available on the server side.

Syntax

bool respawnObject ( object theObject )

OOP Syntax Help! I don't understand this!

Method: object:respawn(...)


Required Arguments

Returns

  • true if the object was sucessfully respawned.
  • false if the object is not breakable, or a wrong object was given.

Example

This example prevents objects from despawning. When an object breaks, it gets respawned right away.

addEventHandler ( "onClientObjectBreak", getRootElement(),
    function ()
        respawnObject ( source )
    end
)

See Also