GrantPlayerSpell: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Automatyczna aktualizacja dokumentacji funkcji
 
Complete Lua function catalog
 
Line 31: Line 31:
* Available only in server-side resource scripts.
* Available only in server-side resource scripts.


[[Category:Lua Functions]]
[[Category:Server Functions]]
[[Category:Server Functions]]
[[Category:Magic Functions]]
[[Category:Magic Functions]]
[[Category:Progression Functions]]
[[Category:Progression Functions]]

Latest revision as of 09:53, 15 August 2026

grantPlayerSpell

Grants or clears a player spell. This is a readable alias of setPlayerSpellGranted.

Syntax

bool grantPlayerSpell(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:

grantPlayerSpell(playerId, SPELL.FIRE_ARROW, true)

Notes

  • Available only in server-side resource scripts.