GetPlayerMagicState
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.