Postado Outubro 10, 2022 3 anos Autor 1 minuto atrás, hiquezerah disse: @Aizuuu O último código que te enviei ja está com essa verificação, você testou? E pq tem q colocar o nome dos bixo para desaparecer pow
Postado Outubro 10, 2022 3 anos 1 minuto atrás, Aizuuu disse: E pq tem q colocar o nome dos bixo para desaparecer pow colocar nome de bicho para desaparecer? nesse script eu coloquei um array para você adicionar os monstros que não deve desaparecer.
Postado Outubro 10, 2022 3 anos Autor a Editado Outubro 10, 2022 3 anos por Aizuuu apagar (veja o histórico de edições)
Postado Outubro 10, 2022 3 anos Autor 15 horas atrás, hiquezerah disse: local monsters = { [1] = {monstro = "Wolf", chance = 50, time = 10}, --[Ordem numerica] = {nome do monstro = Bulbasaur, chance = chance de aparecer esse monstro} [2] = {monstro = "Wolf Beast", chance = 40, time = 10}, --[Ordem numerica] = {nome do monstro = Bulbasaur, chance = chance de aparecer esse monstro} [3] = {monstro = "Bandit", chance = 80, time = 10} --[Ordem numerica] = {nome do monstro = Bulbasaur, chance = chance de aparecer esse monstro} } local function getRandomMonster(t) local i = math.random(1, #t) i = t[i] if math.random(1, 100) <= i.chance then return i end return getRandomMonster(t) end local chance = 60 -- 60% de chance de sucesso e 40% de falhar local shinys = {"Bandit"} -- adiciona o nome dos pokemons que não deverão sumir aqui. function onStepIn(cid, item, toPosition, fromPosition) if isPlayer(cid) and math.random(1, 100) <= chance and getPlayerStorageValue(cid, 74480) <= os.time() then local tempo = 1 local i = getRandomMonster(monsters) local monstro = doCreateMonster(i.monstro, getCreaturePosition(cid)) setPlayerStorageValue(cid, 74480, i.time*1000 + os.time()) doCreatureSay(monstro, "Um " ..i.monstro.. " Selvagem Apareceu!", TALKTYPE_MONSTER) addEvent(function() if isCreature(monstro) and not isInArray(shinys, i.monstro) then doRemoveCreature(monstro) end end, tempo*60*1000) end return true end Entao Men Funcionou So Que Mesmo Depois De 10 Segundos Os Bixo Nao Aparece Mais! @hiquezerah Editado Outubro 10, 2022 3 anos por Aizuuu erro (veja o histórico de edições)
Postado Outubro 10, 2022 3 anos local monsters = { [1] = {monstro = "Wolf", chance = 50, time = 10}, --[Ordem numerica] = {nome do monstro = Bulbasaur, chance = chance de aparecer esse monstro} [2] = {monstro = "Wolf Beast", chance = 40, time = 10}, --[Ordem numerica] = {nome do monstro = Bulbasaur, chance = chance de aparecer esse monstro} [3] = {monstro = "Bandit", chance = 80, time = 10} --[Ordem numerica] = {nome do monstro = Bulbasaur, chance = chance de aparecer esse monstro} } local function getRandomMonster(t) local i = math.random(1, #t) i = t[i] if math.random(1, 100) <= i.chance then return i end return getRandomMonster(t) end local chance = 60 -- 60% de chance de sucesso e 40% de falhar local shinys = {"Bandit"} -- adiciona o nome dos pokemons que não deverão sumir aqui. function onStepIn(cid, item, toPosition, fromPosition) if isPlayer(cid) and math.random(1, 100) <= chance and getPlayerStorageValue(cid, 74480) <= os.time() then local tempo = 1 local i = getRandomMonster(monsters) local monstro = doCreateMonster(i.monstro, getCreaturePosition(cid)) setPlayerStorageValue(cid, 74480, i.time + os.time()) doCreatureSay(monstro, "Um " ..i.monstro.. " Selvagem Apareceu!", TALKTYPE_MONSTER) addEvent(function() if isCreature(monstro) and not isInArray(shinys, i.monstro) then doRemoveCreature(monstro) end end, tempo*60*1000) end return true end Editado Outubro 11, 2022 3 anos por hiquezerah (veja o histórico de edições)
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.