SetPlayerMana

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 13:29, 20 October 2026 by QCherry (talk | contribs) (Release 0.1.9 / BUILD264 / Protocol42: availability and download setup; preserve experimental limits)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 (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.