local cfg = {
from_pos = {x = 1707,y = 2305,z = 7}, -- area south-west corner.
to_pos = {x = 1729,y = 2343,z = 7}, -- area north-east corner.
mobpos = {x = 1000,y = 2343,z = 7}, --pos where this monster will be summoned
wallpos = {x = 1010,y= 1212,z=7}, -- pos of the wall
timetospawn = 20 -- seconds to spawn this creature(s)
wallid = x -- Change this to the id of the wall
}
local mob = {"Rat", "Caverat"} -- change rat and caverat to a creature names :)
local function k()
doCreateMonster(mob[math.random(#mob)], cfg.mobpos, false, true, true)
doCreateItem(cfg.wallid, 1, cfg.wallpos)
end
function onKill(cid, target, damage, flags)
if isMonster(target) and getCreatureMaster(target) == target and isInRange(getCreaturePosition(target), cfg.from_pos, cfg.to_pos) and isInArray(mob, getCreatureName(target):lower()) then
doRemoveItem(getTileItemById(cfg.wallpos, cfg.wallid).uid)
addEvent(k, cfg.timetospawn*1000)
end
return true
end