SA

[Encerrado] ayuda en movement

Por samuelitho, 17 de set. de 2018 em Tópicos Sem Resposta

4
1.2k
samuelithoS
17 de setembro de 2018 às 12:04

cnecesito su ayuda para hacer que cada pokemon nasca con nivel diferente ejemplo que butterfly nasca nivel 30, metapod lvl 10, caterpie 5 

Spoiler
local cfg = {
monsters = {"Butterfly", "Metapod", "Caterpie", "Pidgey", "Beedrill", "Meowth", "Pidgeotto"},
grassChance = 25, -- % chance create monster
timeTo = 5, -- 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

 

samuelithoS
20 de setembro de 2018 às 14:28

up

1 mês depois...
MarshmelloM
29 de outubro de 2018 às 14:58
local cfg = {
monsters = {"Butterfly", "Metapod", "Caterpie", "Pidgey", "Beedrill", "Meowth", "Pidgeotto"},


grassChance = 25, -- % chance create monster
timeTo = 5, -- 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
if getCreatureName(cid) == "Butterfly" or getCreatureName(cid) == "Metapod" or getCreatureName(cid) == "Caterpie" or getCreatureName(cid) == "Pidgey" or getCreatureName(cid) == "Beedrill" or getCreatureName(cid) == "Meowth" or getCreatureName(cid) == "Pidgeotto" or getCreatureName(cid) == "Marshtomp" then

end
doCreateMonster(cfg.monsters[math.random(1, #cfg.monsters)], getCreaturePosition(cid))
local lvl = math.random(10, 30) 
local nick = ""..getCreatureName(cid).." ["..lvl.."]" 
doCreatureSetNick(cid, nick) 
addEvent(doSendMagicEffect, 1 * 1000, getCreaturePosition(cid), 14)
setGlobalStorageValue(14260, os.time() + cfg.timeTo)
end
return true
end
4 meses depois...
MarshmelloM
20 de fevereiro de 2019 às 16:31
A questão neste suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.