OnPlayerSpellEquip
Jump to navigation
Jump to search
onPlayerSpellEquip
Triggered when the authoritative equipped or in-hand state of a spell changes.
Availability
This event is available in server-side scripts.
Callback signature
onPlayerSpellEquip(playerId, spellKey, spellId, spellLevel, equipped, inHand)
Parameters
| Name | Type | Description |
|---|---|---|
playerId |
int |
The player changing spell equipment. |
spellKey |
string |
The stable spell definition key. |
spellId |
int |
The numeric spell ID. |
spellLevel |
int |
The spell level reported by the client and validated by the server. |
equipped |
bool |
Whether the spell is equipped. |
inHand |
bool |
Whether the spell is currently held for casting. |
Examples
Handle the event:
addEventHandler("onPlayerSpellEquip", root, function(playerId, spellKey, spellId, spellLevel, equipped, inHand)
outputDebugString(getPlayerName(playerId) .. " spell " .. spellKey .. " inHand=" .. tostring(inHand))
end)