SetPlayerMana
setPlayerMana
Sets a player's authoritative current mana value.
Syntax
bool setPlayerMana(int playerId, number value)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playerId |
int |
yes | The connected player to update. |
value |
number |
yes | The new current mana value. |
Returns
Returns true when the value is accepted; otherwise returns false.
Examples
Set a player's current mana:
setPlayerMana(playerId, 50)
Notes
- Available only in server-side resource scripts.
- This is a convenience wrapper around
setPlayerStat(playerId, "mana", value).
Mana-state correction (from 0.1.9)
The 0.1.9 client clears a stale out-of-mana condition after a successful, verified positive mana assignment. This addresses casting remaining blocked despite the updated mana display, without requiring a game restart. Zero/insufficient mana still blocks ordinary paid casts; rune ownership, equipment, circle and other eligibility checks remain. This improves the existing mana setter; it is not a new Lua function. Separate custom rune manaCost profiles are described in Item type stats and remain under in-game qualification.