onTrigger(string name, boolean state)
onTrigger() is a callback function. This function can be called for several reasons:
- When a player enters a trigger
- When a player exits a trigger
- When a player shoots on a button
- The name of the entity which has triggered the callback.
- The state of the trigger. Take a look on entity page for further details. Example: state is true when player enter a trigger and false is he exists it.
Play a sound
function onTrigger(name, state)
if name == "triggerBoss" and state then