SetPlayerMana

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 20:11, 18 October 2026 by QCherry (talk | contribs) (Document planned 0.1.9 item stats, armor, runes and experimental map-editor seats/lights; not a release)
Jump to navigation Jump to search

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 (planned for 0.1.9)

The upcoming 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. Public 0.1.8 does not include this correction.