GivePlayerSpell
givePlayerSpell
Grants or clears a player's authoritative spell ownership state.
Syntax
bool givePlayerSpell(int playerId, int|string spell [, bool enabled = true])
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playerId |
int |
yes | The connected player identifier. |
spell |
string | yes | A spell id, a stable spell key, or a value from the global SPELL table. |
enabled |
bool |
no | True to grant the spell or false to revoke it; defaults to true. |
Returns
Returns true when the spell grant state is accepted; otherwise returns false.
Examples
Grant Fire Arrow to a player:
givePlayerSpell(playerId, SPELL.FIRE_ARROW)
Notes
- Available only in server-side resource scripts.
- This is an alias of
setPlayerSpellGranted.