GetMonsters: Difference between revisions
Jump to navigation
Jump to search
Document server-owned monsters and interactions |
Complete Lua function catalog |
||
| Line 28: | Line 28: | ||
* Keep monster identifiers as strings; Lua 5.1 numbers cannot exactly represent every 64-bit identifier. | * Keep monster identifiers as strings; Lua 5.1 numbers cannot exactly represent every 64-bit identifier. | ||
[[Category:Lua Functions]] | |||
[[Category:Server Functions]] | [[Category:Server Functions]] | ||
[[Category:World Functions]] | [[Category:World Functions]] | ||
[[Category:Monster Functions]] | [[Category:Monster Functions]] | ||
Latest revision as of 09:52, 15 August 2026
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.