• 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!

Game.createMonster 1.0 error

arthurluna

Member
Joined
Apr 12, 2008
Messages
178
Reaction score
12
How do I only one monster be summoned in a certain area?
it is checked if there is a monster in this particular area if you have not created another show again.
  1. creature:getTile()
  2. getCreaturePosition
  3. getTopCreature(position)
Code:
function onAddItem(moveitem, tileitem, position)
local v = t[tileitem.itemid]
if(v and v.corpse == moveitem.itemid) then
    for x = v.fromPos.x, v.toPos.x do
        for y = v.fromPos.y, v.toPos.y do
            for z = v.fromPos.z, v.toPos.z do
                if(not isMonster(getTopCreature({x = x, y = y, z = z}).uid < v.boss)) then
                           doRemoveItem(moveitem.uid)
                           doSendMagicEffect(position, v.effect)
                    return Game.createMonster(v.boss, {x = math.random(v.fromPosition.x, v.toPosition.x), y = math.random(v.fromPosition.y, v.toPosition.y), z = 13})
                         end
                     end
                  end
             end
        end
    return true
end
 
Last edited:
Back
Top