GetMonsters

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 09:52, 15 August 2026 by QCherry (talk | contribs) (Complete Lua function catalog)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

getMonsters

Returns the identifiers of all server-owned monsters.

Syntax

table getMonsters()

Parameters

This function does not accept parameters.

Returns

Returns a one-based array of opaque decimal monster identifier strings.

Examples

Print every living monster:

for _, monsterId in ipairs(getMonsters()) do
    if isMonsterAlive(monsterId) then
        outputDebugString(monsterId .. " is alive")
    end
end

Notes

  • Available only in server-side resource scripts.
  • Keep monster identifiers as strings; Lua 5.1 numbers cannot exactly represent every 64-bit identifier.