User Tools

Site Tools


modding:function:objdestroy

Discuss this page on this page's Talk Page

objDestroy

See objDestroy at Xelerus

Syntax (objDestroy obj [objSource]) → True/Nil
Arguments obj: The spaceObject that you want to destroy.
[objSource]: An optional spaceObject that destroys the other object.
Returns boolean: True if successful, otherwise Nil.
Category spaceObject
Description If used with only one argument it simply removes the spaceobject from the game. If the optional argument is provided, the function acts as if the target object was destroyed by the source, triggering any OnDestroy events, friend/enemy relations etc…

Example

Assuming that the player has a ship targeted, this will destroy that target:

(objDestroy (objGetTarget gPlayerShip))

With the same assumption, this will destroy that target, and behave as if it was the player who did it:

(objDestroy (objGetTarget gPlayerShip) gPlayerShip)

Return to Functions list

modding/function/objdestroy.txt · Last modified: 2014/12/27 04:40 by 127.0.0.1