Use essa script:
Fiz o mesmo esquema de como sumona criaturas, basta editar a tabela monsters.
Se quiser algo do tipo monstro de acordo com level do player etc, só pedir
local delay = {}
function onUse(cid, item, frompos, item2, topos)
local maxSummons = 8 -- máximo de summons permitidos por player
local timeForReuse = 5 -- segundos para usar novamente
local cost = 1500 -- gold para sumonar
local monsters = { -- tabela com monstros, e a quantidade que vai sumonar
["Rat"] = 3,
["Tiger"] = 2,
}
if delay[0] and delay[0] - os.time() > 0 then
return doPlayerSendCancel(cid, "Espere "..(delay[0] - os.time()).." segundos para puxar a alavanca novamente.")
end
local monsterCount = 0
local guid = getPlayerGUID(cid)
if delay[guid] then
for _, mid in pairs(delay[guid]) do
if isCreature(mid) then
monsterCount = monsterCount + 1
else
delay[guid][_] = nil
end
end
end
if monsterCount >= maxSummons then
return doPlayerSendCancel(cid, "Há muitos monstros sumonados por você, mate-os primeiro!")
end
if not doPlayerRemoveMoney(cid, cost) then
return doPlayerSendCancel(cid, "Você não tem dinheiro suficiente para pagar!")
end
delay[0] = os.time() + timeForReuse
monsterCount = 0
for monsterName, number in pairs(monsters) do
for _ = 1, number do
local newMonster = doCreateMonster(monsterName, getClosestFreeTile(cid, getThingPos(cid), true), false)
if isCreature(newMonster) then
monsterCount = monsterCount + 1
table.insert(delay[guid], newMonster)
doSendMagicEffect(getThingPos(newMonster), CONST_ME_TELEPORT)
if monsterCount >= maxSummons then
return true
end
end
end
end
return true
end







info
Grupo: Artesão
Registrado: 26/04/09
Posts: 120
Reputação: +2
KKKKKKKKKKKKKKKKKK
Verdade cara, olha ta dando esse erro agora
Vlw pelo seu tempo