Files
NGECore2/scripts/commands/teleporttarget.py
T
Waverunner 6f141678d5 Added option to clear characters table
Fixed planets that were trying to load a snapshot file which did not
exist
Changed /teleporttarget to take a command argument if a player is not
selected
2014-08-11 10:55:20 -04:00

26 lines
744 B
Python

import sys
from engine.resources.scene import Point3D
def setup():
return
def run(core, actor, target, commandString):
playerObject = actor.getSlottedObject('ghost')
if not playerObject:
return
if target is None:
target = core.objectService.getObjectByFirstName(commandString)
if target and target.getSlottedObject('ghost') is not None:
actor.sendSystemMessage(' \\#FE2EF7 [GM] \\#FFFFFF teleportTarget: Command completed successfully.', 0)
core.simulationService.teleport(target, actor.getPosition(), actor.getOrientation(), 0)
return
else:
actor.sendSystemMessage(' \\#FE2EF7 [GM] \\#FFFFFF teleportTarget: Invalid Syntax. Syntax is: /teleportTarget <Target> or /teleportTarget <Name>', 0)
return
return