Postado Junho 11, 2019 6 anos Galera estou com esse script, porem ele tem um bug: Se tiver mais de uma pessoa com target no monstro ele sumona a quantidade de targets que tem. Por exemplo: Se tiver 4 pessoas atacando o monstro, assim que ele morre nasce 4 "Bug"... Quero que independente de quantas pessoas estejam atacando nasça 1 só! function onKill(cid, target, lastHit) local monsters = { ["Troll"] = {chance = 100, next = "Bug", msg = {"Zchh","Kzchh"}}, ["Wolf"] = {chance = 100, next = "Rat", msg = {"Zchh","Kzchh"}} } function doRemoveCorpse(pos, creature) for i = 0, 255 do pos.stackpos = i tile = getTileThingByPos(pos) if tile.uid > 0 and isCorpse(tile.uid) then doRemoveItem(tile.uid) end end doSummonCreature(creature, pos) end if isPlayer(cid) and isMonster(target) then local var = monsters[getCreatureName(target)] if var then if var.chance >= math.random(1, 100) then addEvent(doRemoveCorpse, 0, getThingPos(target), var.next) doCreatureSay(target, var.msg[math.random(1, #var.msg)], TALKTYPE_ORANGE_1) end end end return true end Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.
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.