local timeToUse = 300
local monsters = {
{name = "Rat", pos = {x = 111, y = 111, z = 7}},
{name = "Troll", pos = {x = 112, y = 112, z = 7}},
{name = "Demon", pos = {x = 113, y = 113, z = 7}}
}
local lastTime = 0 -- Ignore this
function onUse(cid, item, position, itemEx, toPosition)
local osTime = os.time()
if(lastTime <= osTime) then
for _, mob in ipairs(monsters) do
Game.createMonster(mob.name, mob.pos)
end
lastTime = osTime + timeToUse
end
return true
end