From Onset Developer Wiki
Adds a function as event handler which will be called when a certain event occurs. Multiple functions can be bound to a single event.
The name of the event. See Server Events or Client Events for a list of events.
The function which will be called when the event occurs.
- This function has no specific return value.
function OnPlayerDeath(player, instigator) if instigator == nil then AddPlayerChat(player, "You died :(") else AddPlayerChat(player, "You have been killed by "..GetPlayerName(instigator)) end end AddEvent("OnPlayerDeath", OnPlayerDeath)