GetMonsters

From Wiki G1R-MP G1 Remake Multiplayer
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.