SetPlayerSpellGranted
Jump to navigation
Jump to search
setPlayerSpellGranted
Sets or clears an authoritative spell grant for a player.
Syntax
bool setPlayerSpellGranted(int playerId, int|string spell [, bool enabled = true])
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playerId |
int |
yes | The connected player to update. |
spell |
string | yes | A spell id or stable key. |
enabled |
bool |
no | True to grant the spell, false to revoke it. |
Returns
Returns true when the grant state is accepted; otherwise returns false.
Examples
Grant Fire Arrow to a player:
setPlayerSpellGranted(playerId, SPELL.FIRE_ARROW, true)
Notes
- Available only in server-side resource scripts.