RespawnObject: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(removed {{Needs Example}}, removed unnecessary section) |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{client function}} | {{client function}} | ||
This function respawns a specific object. | This function respawns a specific object. | ||
Line 13: | Line 13: | ||
==Example== | ==Example== | ||
This example prevents objects from despawning. When an object breaks, it gets respawned right away. | This example prevents objects from despawning. When an object breaks, it gets respawned right away. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
Line 21: | Line 20: | ||
end | end | ||
)</syntaxhighlight> | )</syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Client_object_functions}} | {{Client_object_functions}} |
Revision as of 20:44, 4 October 2014
This function respawns a specific object.
Syntax
bool respawnObject ( object theObject )
Required Arguments
- theObject: An object element
Returns
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
- createObject
- getObjectScale
- moveObject
- setObjectScale
- stopObject
- getObjectMass
- getObjectProperty
- setObjectMass
- setObjectProperty