SetMonsterMaxHealth

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 17:34, 2 September 2026 by QCherry (talk | contribs) (Clarify the maximum-health behavior planned for G1R:MP update 0.1.2)
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 heal the monster by itself. 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.