ToggleObjectRespawn: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
Line 10: | Line 10: | ||
bool toggleObjectRespawn ( object theObject, bool respawn ) | bool toggleObjectRespawn ( object theObject, bool respawn ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[object]]:toggleObjectRespawn}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theObject''': | *'''theObject''': the object you want to toggle the respawn from | ||
*'''respawn ''': | *'''respawn ''': a bool denoting whether we want to enable (''true'') or disable (''false'') respawning | ||
===Returns=== | ===Returns=== | ||
* ''true'' when the it was changed successfully. | |||
* ''false'' otherwise. | |||
==Example== | ==Example== |
Revision as of 23:05, 4 October 2014
This function is used to toggle if an object should respawn after it got destroyed
Syntax
bool toggleObjectRespawn ( object theObject, bool respawn )
OOP Syntax Help! I don't understand this!
- Method: object:toggleObjectRespawn(...)
Required Arguments
- theObject: the object you want to toggle the respawn from
- respawn : a bool denoting whether we want to enable (true) or disable (false) respawning
Returns
- true when the it was changed successfully.
- false otherwise.
Example
This example adds command tos that toggles respawn of all the objects.
local respawn = false addCommandHandler("tos", function () for i, object in pairs(getElementsByType("object")) do toggleObjectRespawn(object, not respawn) end outputChatBox("Object respawning " .. (respawn and "disabled" or "enabled")) respawn = not respawn end)
See Also
- createObject
- getObjectScale
- moveObject
- setObjectScale
- stopObject
- getObjectMass
- getObjectProperty
- setObjectMass
- setObjectProperty