Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
i want to do a global event to check if a monster x is alive anywere in map and the only way i know to check if the monster is alive é by checking every single tile in map.
Is there a better way to do it?
local CreatureID = Creature("Demon Boss")
if CreatureID ~= nil then
-- If creature exists!
else
-- If creature doesnt exist.
end
If there's multiple creatures with the same name and you want to execute code on all of them..
Code:
local CreatureID = Creature("Demon")
if CreatureID ~= nil then
for _,pid in ipairs(CreatureID) do
--- All creatures now had ID pid. Execute code on pid as creatureid.
end
else
-- If no creature
end
Well depends what you are checking, a boss? or a area with monsters and etc...
There is few ways to handle this. First one, which has been already explained by @kyoushirou. Second would Game.getSpectators to check area or thrid would use global storage. When it's die then it should add BOSS_DEAD = 1 and when it respawn then BOSS_DEAD = 0.