GetPlayerMagicState: 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:53, 15 August 2026
getPlayerMagicState
Returns the server-authoritative spellcasting state of a connected player.
Syntax
table getPlayerMagicState(int playerId)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playerId |
int |
yes | The connected player to inspect. |
Returns
Returns a table containing circle, mana, equipped/active spell, cast phase, timing and granted-spell data, or false for an invalid player.
Examples
Check which spell a player is casting:
local magic = getPlayerMagicState(playerId)
if magic and magic.activeSpell ~= "none" then
print("Cast phase:", magic.phase)
print("Spell:", magic.activeSpell)
end
Notes
- Available only in server-side resource scripts.