GetMonsterAttackDamage
Jump to navigation
Jump to search
getMonsterAttackDamage
AVAILABLE FROM UPDATE 0.1.2
This function is available in G1R:MP 0.1.2 and later. The contract below includes the compatibility guarantees introduced in that update.
Returns a monster instance's authoritative base melee damage.
Syntax
number|false getMonsterAttackDamage(string monsterId)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
monsterId |
string |
yes | The opaque decimal monster identifier returned by spawnMonster or getMonsters.
|
Returns
Returns the current per-instance base melee damage, or false when the monster identifier is invalid.
Examples
Inspect a monster's base melee damage:
local damage = getMonsterAttackDamage(monsterId)
if damage ~= false then
outputDebugString("Monster base damage: " .. damage)
end
Notes
- Available only in server-side resource scripts.
- A newly spawned monster starts with the base damage from its catalog type. This getter reports the current per-instance value.
- The server reads this value when an attack reaches its impact frame, before applying the target's armor resistance and the configured server damage multiplier.