GivePlayerSpell

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 09:53, 15 August 2026 by QCherry (talk | contribs) (Complete Lua function catalog)
Jump to navigation Jump to search

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.