respawnObject | Multi Theft Auto: Wiki Skip to content

respawnObject

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function respawns a specific object.

OOP Syntax Help! I don't understand this!

Syntax

bool respawnObject ( object theObject )
Required Arguments
  • theObject: an object element

Returns

  • bool: value

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

Code Examples

shared

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

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