IsPlayerSpellGranted: Difference between revisions
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:Player Functions]] | [[Category:Player Functions]] | ||
Latest revision as of 09:54, 15 August 2026
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.