RespawnObject: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (whitespace fix)
No edit summary
Line 11: Line 11:
===Returns===
===Returns===
Returns ''true'' if the object was sucessfully respawned. ''false'' if the object is not breakable, or a wrong object was given.
Returns ''true'' if the object was sucessfully respawned. ''false'' if the object is not breakable, or a wrong object was given.
==Example==
<section class="client" name="Client" show="true">
This example prevents objects from despawning. When an object breaks, it gets respawned right away.
<syntaxhighlight lang="lua">
addEventHandler ( "onClientObjectBreak", getRootElement(),
    function ()
        respawnObject ( source )
    end
)</syntaxhighlight>
</section>


==See Also==
==See Also==
{{Client_object_functions}}
{{Client_object_functions}}

Revision as of 17:28, 4 October 2014

Accessories-text-editor.png Script Example Missing Function RespawnObject needs a script example, help out by writing one.

Before submitting check out Editing Guidelines Script Examples.

This function respawns a specific object.

Syntax

bool respawnObject ( object theObject )

Required Arguments

Returns

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

Example

Click to collapse [-]
Client

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

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

See Also