on
on(name: string, fn: (...) -> ())
Listens to an event.
Several functions can listen to the same event; they are called in order. An error in one does not prevent the others.
Parameters#
- name (
string): event name - fn (
(...) -> ()): function called
Example#
on("playerJoin", function(player)
log(player.name, "joined")
end)