Exports and Events
Use these when your server's death or ambulance script should decide when the spirit appears, for example with a script LenoSpirit doesn't detect, or to show it on full death instead of on last stand.
Client export
| Export | Returns | Description |
|---|---|---|
Trigger() | — | Plays the spirit for the local player, as if they had just died |
lua
-- in your death script, client side, at the moment the player dies
exports.leno_spirit:Trigger()Client event
The same thing as a local client event, if you prefer events over exports:
lua
TriggerEvent('leno_spirit:trigger')It is a local event (AddEventHandler), so other clients and the server can't trigger it.
What still applies
A manual trigger goes through the same checks as a detected death:
General.cooldownSeconds;- the on / off state (
General.enabled,General.activePeriod,/spiritadmin); General.visibility: with'nearby', players near the dead player see the spirit too;- players who hid the effect with
/spiritdon't see it.
WARNING
If you trigger the effect yourself, set General.triggerMode = 'manual'. Otherwise the built-in detection also fires. On last-stand scripts that can play a second spirit: one when the player goes down, and one when your script triggers it.
