RespawnObject: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{client function}}
{{Client function}}
This function respawns a specific object.
This function respawns a specific object.


Line 10: Line 10:


===Returns===
===Returns===
Returns ''true'' if the object was sucessfully respawned. ''false'' if the object is not breakable, or a wrong object was given.
* ''true'' if the object was sucessfully respawned.
* ''false'' if the object is not breakable, or a wrong object was given.


==Example==
==Example==

Revision as of 22:35, 4 October 2014

This function respawns a specific object.

Syntax

bool respawnObject ( object theObject )

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