Events
events are fired when the action is triggered
IsInGame
Fires when the player is in a save
Warning
This event isn't async, wait() does not work here
OnJoinGame
Fires when the player loads a save
Warning
This event isn't async, wait() does not work here
OnAsteroidDestroyed
Fires when the player destroy an asteroid
Args
count returns the number of asteroids destroyed since the save was created
RegisterEvent("OnAsteroidDestroyed", function(count)
wait(1)
print("Asteroids destroyed : " .. count)
end)
OnEnemieKilled
Fires when an enemie has been killed by the player
Args
count returns the number of enemies killed since the save was created
OnCargoChanged
Fires when the player cargo changed
Args
count returns the current cargo that the player hold
OnStationChanged
Fires when the player travels to a different station
Args
id returns the current station id
OnStationDocked
Fires when the player docked in a station
RegisterEvent("OnStationDocked", function()
wait(1)
print("You docked in this station " .. station.name)
end)
IsInMainMenu
Fires when the player is in the main menu
Warning
This event isn't async, wait() does not work here
OnMoneyChanged
Fires when the player money changed
Warning
This event isn't async, wait() does not work here
Args
money returns the current player money
OnSystemChanged
Fires when the player travels to a different system
Args
id returns the current system id
OnUpdate
Fires every ticks
Warning
This event isn't async, wait() does not work here
EarlyInit
Warning
This event isn't async, wait() does not work here
Args
This event is mandatory if you want to create new contents in the game such as custom ships, custom items and more