if IsObjectExists ('mon')==true then, sorry, here's my advice - but there's an error in the IsObjectExists function - the letter S is required at the end. If there is no monster, it outputs nil (exactly nil, and not all sorts of true and false).
(It happens :smile04:, that's why I advised using a script editor to check).
Oligarch, in your case, you need
if IsObjectExists ('mon')==nil ...
Use prints - it's the perfect option for catching errors
print (IsObjectExists('mon')); - and look in the console
And I wrote Exist instead of Exists! I fixed it, and it worked right away.:smile52: