Postado Maio 27, 2021 4 anos Boa tarde, Eu gostaria de uma ajuda com um script que na verdade e pasta lib junto com a Talkactions Dando problema kkk. Bem e o seguinte eu adicionei um sistema de /autoloot esse. Porem meu servidor ele tem uma moeda a + que e a SLAYER Coin ID 2157, Eu tentei modificar o arquivo lib para pegar essa nova moeda, não deu erro na hora de ligar o servidor, Porem 2 coisas ta acontecendo, 1 ele ainda n esta coletando o item com id 2157 do slayer Coin, e quando digita o comando para desativar e aonde ele apresenta erro ERRO Spoiler [26/05/2021 12:54:13] [Error - TalkAction Interface] [26/05/2021 12:54:13] data/talkactions/scripts/2021/autoloot_talk.lua:onSay [26/05/2021 12:54:13] Description: [26/05/2021 12:54:13] data/talkactions/scripts/2021/autoloot_talk.lua:7: attempt to call global 'unregisterCreatureEvent' (a nil value) [26/05/2021 12:54:13] stack traceback: [26/05/2021 12:54:13] data/talkactions/scripts/2021/autoloot_talk.lua:7: in function <data/talkactions/scripts/2021/autoloot_talk.lua:1> Eu não sou profissional em script, nem nada, mais sei o basico do basico aonde vou fuçando e acabo ajeitando na "GAMBIARRA", Não critica o que eu fiz no arquivo lib que eu editei adicionando a outra moeda 2157. MEU ARQUIVO LIB DPS DE EU FUÇAR. Spoiler AUTO_LOOT_TAX = 50 -- Tax for using the service (in %) (min 0, max 100) AUTO_LOOT_BANK = true -- Will the money go to the bank? If false, the money will go to the player AUTO_LOOT_STORAGE = 38199 -- Storage of the status of the Auto Loot function findItemsInContainer(ids, container) local items_found = {} local v_uids = {} for i = 0, getContainerSize(container)-1 do container_item = getContainerItem(container, i) if isContainer(container_item.uid) then local container_recursive = findItemsInContainer(ids, container_item.uid) for a, b in ipairs(container_recursive) do if not isInArray(v_uids, b.uid) then table.insert(v_uids, container_item.uid) table.insert(items_found, b) end end end if isInArray(ids, container_item.itemid) and not isInArray(v_uids, container_item.uid) then table.insert(v_uids, container_item.uid) table.insert(items_found, container_item) end end return items_found end function executeAutoLoot(cid, pos, target_name) AUTO_LOOT_TAX = AUTO_LOOT_TAX > 100 and 100 or AUTO_LOOT_TAX < 0 and 0 or AUTO_LOOT_TAX local corpse = getTileItemByType(pos, ITEM_TYPE_CONTAINER).uid local total_count = 0 for a, b in ipairs(findItemsInContainer({ITEM_GOLD_COIN, ITEM_PLATINUM_COIN, ITEM_CRYSTAL_COIN, ITEM_SLAYER_COIN}, corpse)) do if b.itemid == ITEM_SLAYER_COIN then total_count = total_count+b.type*1000000 elseif b.itemid == ITEM_CRYSTAL_COIN then total_count = total_count+b.type*10000 elseif b.itemid == ITEM_PLATINUM_COIN then total_count = total_count+b.type*100 elseif b.itemid == ITEM_GOLD_COIN then total_count = total_count+b.type end doRemoveItem(b.uid, b.type) end if AUTO_LOOT_BANK then doPlayerSetBalance(cid, getPlayerBalance(cid)+math.ceil(total_count*(1-AUTO_LOOT_TAX/100))) else doPlayerAddMoney(cid, math.ceil(total_count*(1-AUTO_LOOT_TAX/100))) end if total_count > 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Dinheiro arrecadado de "..target_name..": "..total_count.." gold coins."..(AUTO_LOOT_TAX > 0 and " Imposto ("..AUTO_LOOT_TAX.."%) com desconto: "..math.floor(total_count*(AUTO_LOOT_TAX/100)).." gold coins." or " Nenhum imposto.")) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Total coletado: "..math.ceil(total_count*(1-AUTO_LOOT_TAX/100)).." gold coins.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Nenhum dinheiro coletado de "..target_name..".") end return true end Então e isso alguem pode me ajudar, a coloca essa moeda 2157 para ser colhida igual as outras, e para que possa cancelar o autoloot. SLAYER_COIN Meu novo projeto. http://oi58.tinypic.com/2yplmrk.jpg
Postado Junho 4, 2021 4 anos Para seu lib funcionar dessa forma, vc precisa ter declarado uma variável global para 'ITEM_SLAYER_COIN' em algum lugar, ou simplesmente substituir esse 'ITEM_SLAYER_COIN' por 2157 no script. Sobre o erro do talkaction, seria interessante vc postar seu script da forma que está no seu servidor para análise. Te ajudei? Clique em Gostei ! ²²²d¬¬b²²² "She's got a smile that it seems to me...." ♪♪
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.