Player
The player object gives you access to the player's data and actions
Properties
| Property | Type | Description |
|---|---|---|
money |
number |
The player's current money |
enemieskilled |
number |
The number of enemies killed since the save was created |
level |
number |
The player's level |
visitedstations |
number |
The number of stations the player has visited |
cargosalvagedcount |
number |
The number of cargo the player has salvaged |
asteroidsdestroyedcount |
number |
The number of asteroids the player has destroyed |
Properties are readable and writable
Methods
GetShipInfo
Returns a table containing the player's ship information
local shipinfo = player:GetShipInfo()
print(shipinfo["cargo"])
print(shipinfo["maxcargo"])
print(shipinfo["armor"])
print(shipinfo["maxhealth"])
SetShipInfo
Sets the player's ship information
Args
shipinfo - A table containing the ship properties to update
HasShipArmor
Returns true if the player's ship has an armor equipped
HasJumpDrive
Returns true if the player's ship has a jump drive equipped
IsDocked
Returns true if the player is currently docked in a station
ToggleCloaking
Toggles the player's cloaking device
SetPosition
Teleports the player to the given coordinates
Args
x, y, z - The target coordinates