Teste o script dessa maneira
explicação:
[1] = {monsters = "Pidgey", grassChance = 15, timeTo = 10, level = 100} level necessário para fazer o pidgey
script:
local config =
{
[1] = {monsters = "Pidgey", grassChance = 15, timeTo = 10, level = 100}
}
function onStepIn(cid, item, pos)
for i=1, #config do
if getPlayerLevel(cid) >= config.level then
elseif getGlobalStorageValue(14260) > os.time() then
elseif math.random(100) <= config.grassChance then
doCreateMonster(config.monsters[math.random(1, #config.monsters)], getCreaturePosition(cid))
addEvent(doSendMagicEffect, 1 * 1000, getCreaturePosition(cid), 14)
setGlobalStorageValue(14260, os.time() + config.timeTo)
end
return true
end
end






info
Grupo: Campones
Registrado: 04/12/11
Posts: 79
Reputação: +1
como puedo hacer para que los pokemones spawn por nivel
AQUI ESTA EL MOVEMENT COMO PUEDO EDITARLO PARA QUE SALGAN CON NIVEL
local cfg = {
monsters = {"Pidgey"},
grassChance = 15, -- % chance create monster
timeTo = 10, -- Seconds so you can use them again
}
function onStepIn(cid, item, pos)
if not isPlayer(cid) then return true end
if getGlobalStorageValue(14260) > os.time() then return true end
if math.random(100) <= cfg.grassChance then
doCreateMonster(cfg.monsters[math.random(1, #cfg.monsters)], getCreaturePosition(cid))
addEvent(doSendMagicEffect, 1 * 1000, getCreaturePosition(cid), 14)
setGlobalStorageValue(14260, os.time() + cfg.timeTo)
end
return true
end