Postado Setembro 29, 2017 7 anos como o @Dwarfer disse, você que configurou errado mesmo, testei aqui e ta 100%
Postado Setembro 29, 2017 7 anos Autor 17 horas atrás, Dwarfer disse: Se configurar corretamente, vai funcionar. Observe se tá colocando o actionid correto na árvore e na tag. em vez de: <action actionid="ACTION_ID_DA_ARVORE" script="treemonster.lua" /> Coloquei: <action itemid="ACTION_ID_DA_ARVORE" event="script" value="treemonster.lua"/>, e funcionou tem alguma forma de colocar 1 exaust no tempo q ele pode bater exemplo: Eu bati na arvore dps de 30seg eu posso bater novamente.
Postado Setembro 29, 2017 7 anos Solução @bismarkzika Spoiler local tempo = 30 -- tempo em segundos local monsters = { [80] = {"Dwarf", "Rotworm", "Orc"}, --[chance] = {para cair um dos monstros} [60] = {"Dwarf Soldier", "Elf Scout", "Tarantula"}, [50] = {"Dwarf Guard", "Cyclops Drone", "Cyclops Smith"}, [40] = {"Dwarf Geomancer", "Cyclops Smith", "Elf Arcanist"}, [30] = {"Axeitus Headbanger", "Dragon", "Frost Dragon Hatchling"}, [10] = {"Foreman Kneebiter", "Dragon Lord", "Giant Spider"} } function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, 23491) >= os.time() then doPlayerSendCancel(cid, "You must wait " .. tempo .. " to use again.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) return true end local e = {2,3,4,5,6,9} local t = {} for _, v in pairs(monsters) do table.insert(t, _) end table.sort(t) for _, v in pairs(t) do if math.random(1, 100) < v then c = v break end end local m = monsters[c][math.random(1,#monsters[c])] local monster = doCreateMonster(m, getPlayerPosition(cid)) doSendMagicEffect(getCreaturePosition(monster), CONST_ME_TELEPORT) doSendMagicEffect(toPosition, e[math.random(1,#e)]) doCreatureSay(monster, m.." was hidden on top of the tree! HAHAHA!", TALKTYPE_ORANGE_1) setPlayerStorageValue(cid, 23491, tempo + os.time()) return true end Contato: Email: [email protected] Discord: Dwarfer#2715
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.