SetMonsterMaxHealth

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 17:32, 2 September 2026 by QCherry (talk | contribs) (Document Lua functions planned for G1R:MP update 0.1.2)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

setMonsterMaxHealth

COMING IN UPDATE 0.1.2
This function is documented in advance and is not yet available in the current public release.

Changes a monster's authoritative maximum health for elite and boss variants.

Syntax

bool setMonsterMaxHealth(string monsterId, number maxHealth)

Parameters

Name Type Required Description
monsterId string yes The opaque decimal monster identifier returned by spawnMonster or getMonsters.
maxHealth number yes A finite maximum-health value greater than 0 and no greater than 1000000.

Returns

Returns true when the new maximum is accepted and replicated; otherwise returns false.

Examples

Create a tougher encounter and then fill its health:

if setMonsterMaxHealth(monsterId, 2500) then
    setMonsterHealth(monsterId, 2500)
end

Notes

  • Available only in server-side resource scripts.
  • Raising the maximum does not automatically heal the monster. Lowering it atomically clamps current health to the new maximum.
  • Use setMonsterHealth after this call when an elite or boss should start at full health.