IsPlayerSpellGranted
Jump to navigation
Jump to search
isPlayerSpellGranted
Checks whether a player has an authoritative spell grant.
Syntax
bool isPlayerSpellGranted(int playerId, int|string spell)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playerId |
int |
yes | The connected player to inspect. |
spell |
string | yes | A spell id or stable key. |
Returns
Returns true if the spell is granted; otherwise returns false.
Examples
Check for Fire Arrow before granting it:
if not isPlayerSpellGranted(playerId, SPELL.FIRE_ARROW) then
grantPlayerSpell(playerId, SPELL.FIRE_ARROW)
end
Notes
- Available only in server-side resource scripts.