Postado Maio 4, 2014 11 anos Estou meio sem paciência tentando arrumar esse script "facinho" do rust remover, mas já ta chato! O erro é o seguinte: quando coloco o item do rust remover (id 9930) no chão e dou use nele e no rust armor/legs o rust remover não desaparece! Fica infinito no chão. Lembro que quando o rust remover está na Bp, o item desaparece normalmente. Segue o script: function onUse(cid, item, frompos, item2, topos) local effect_broke = 3 local effect_renew = 28 local developed = 0 local const = item2.itemid local pos = getCreaturePosition(cid) local item = { [9808] = { [1] = {id = 2464, name = "Chain Armor", opportunity = 33}, [2] = {id = 2483, name = "Scale Armor", opportunity = 25}, [3] = {id = 2465, name = "Brass Armor", opportunity = 10}, [4] = {id = 2463, name = "Plate Armor", opportunity = 2} }, [9809] = { [1] = {id = 2464, name = "Chain Armor", opportunity = 16}, [2] = {id = 2465, name = "Brass Armor", opportunity = 14}, [3] = {id = 2483, name = "Scale Armor", opportunity = 13}, [4] = {id = 2463, name = "Plate Armor", opportunity = 10}, [5] = {id = 2476, name = "Knight Armor", opportunity = 6}, [6] = {id = 8891, name = "Paladin Armor", opportunity = 3}, [7] = {id = 2487, name = "Crown Armor", opportunity = 1} }, [9810] = { [1] = {id = 2464, name = "Chain Armor", opportunity = 20}, [2] = {id = 2465, name = "Brass Armor", opportunity = 17}, [3] = {id = 2483, name = "Scale Armor", opportunity = 15}, [4] = {id = 2463, name = "Plate Armor", opportunity = 12}, [5] = {id = 2476, name = "Knight Armor", opportunity = 10}, [6] = {id = 8891, name = "Paladin Armor", opportunity = 5}, [7] = {id = 2487, name = "Crown Armor", opportunity = 4}, [8] = {id = 2466, name = "Golden Armor", opportunity = 2}, [9] = {id = 2472, name = "Magic Plate Armor", opportunity = 1} }, [9811] = { [1] = {id = 2468, name = "Studded Legs", opportunity = 33}, [2] = {id = 2648, name = "Chain Legs", opportunity = 25}, [3] = {id = 2478, name = "Brass Legs", opportunity = 10}, [4] = {id = 2647, name = "Plate Legs", opportunity = 2} }, [9812] = { [1] = {id = 2468, name = "Studded Legs", opportunity = 16}, [2] = {id = 2648, name = "Chain Legs", opportunity = 14}, [3] = {id = 2478, name = "Brass Legs", opportunity = 13}, [4] = {id = 2647, name = "Plate Legs", opportunity = 10}, [5] = {id = 2477, name = "Knight Legs", opportunity = 6}, [7] = {id = 2488, name = "Crown Legs", opportunity = 1} }, [9813] = { [2] = {id = 2478, name = "Brass Legs", opportunity = 17}, [4] = {id = 2647, name = "Plate Legs", opportunity = 12}, [5] = {id = 2477, name = "Knight Legs", opportunity = 10}, [7] = {id = 2488, name = "Crown Legs", opportunity = 4}, [8] = {id = 2470, name = "Golden Legs", opportunity = 2} } } if item[const] then local random_item = math.random(1, 100) for i = 1, #item[const] do if random_item <= item[const].opportunity then developed = i end end if developed > 0 then doSendMagicEffect(topos, effect_renew) doTransformItem(item2.uid, item[const][developed].id) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have renewed the ".. item[const][developed].name .." !") doPlayerRemoveItem(cid, 9930, 1) else doSendMagicEffect(topos, effect_broke) doRemoveItem(item2.uid, 1) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your Rusty Remover has broken.") doPlayerRemoveItem(cid, 9930, 1) return false end doRemoveItem(getTileItem(id, 9930).uid) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Use it on Rusty Items (Common, Semi-Rare or Rare: Armors, Legs, helmets, boots or shields).") return false end return false end Te Ajudei? Rep+
Postado Maio 4, 2014 11 anos Dei uma modificadinha ... testa ai! local item = { [9808] = { [1] = {id = 2464, name = "Chain Armor", opportunity = 33}, [2] = {id = 2483, name = "Scale Armor", opportunity = 25}, [3] = {id = 2465, name = "Brass Armor", opportunity = 10}, [4] = {id = 2463, name = "Plate Armor", opportunity = 2} }, [9809] = { [1] = {id = 2464, name = "Chain Armor", opportunity = 16}, [2] = {id = 2465, name = "Brass Armor", opportunity = 14}, [3] = {id = 2483, name = "Scale Armor", opportunity = 13}, [4] = {id = 2463, name = "Plate Armor", opportunity = 10}, [5] = {id = 2476, name = "Knight Armor", opportunity = 6}, [6] = {id = 8891, name = "Paladin Armor", opportunity = 3}, [7] = {id = 2487, name = "Crown Armor", opportunity = 1} }, [9810] = { [1] = {id = 2464, name = "Chain Armor", opportunity = 20}, [2] = {id = 2465, name = "Brass Armor", opportunity = 17}, [3] = {id = 2483, name = "Scale Armor", opportunity = 15}, [4] = {id = 2463, name = "Plate Armor", opportunity = 12}, [5] = {id = 2476, name = "Knight Armor", opportunity = 10}, [6] = {id = 8891, name = "Paladin Armor", opportunity = 5}, [7] = {id = 2487, name = "Crown Armor", opportunity = 4}, [8] = {id = 2466, name = "Golden Armor", opportunity = 2}, [9] = {id = 2472, name = "Magic Plate Armor", opportunity = 1} }, [9811] = { [1] = {id = 2468, name = "Studded Legs", opportunity = 33}, [2] = {id = 2648, name = "Chain Legs", opportunity = 25}, [3] = {id = 2478, name = "Brass Legs", opportunity = 10}, [4] = {id = 2647, name = "Plate Legs", opportunity = 2} }, [9812] = { [1] = {id = 2468, name = "Studded Legs", opportunity = 16}, [2] = {id = 2648, name = "Chain Legs", opportunity = 14}, [3] = {id = 2478, name = "Brass Legs", opportunity = 13}, [4] = {id = 2647, name = "Plate Legs", opportunity = 10}, [5] = {id = 2477, name = "Knight Legs", opportunity = 6}, [7] = {id = 2488, name = "Crown Legs", opportunity = 1} }, [9813] = { [2] = {id = 2478, name = "Brass Legs", opportunity = 17}, [4] = {id = 2647, name = "Plate Legs", opportunity = 12}, [5] = {id = 2477, name = "Knight Legs", opportunity = 10}, [7] = {id = 2488, name = "Crown Legs", opportunity = 4}, [8] = {id = 2470, name = "Golden Legs", opportunity = 2} } } local developed = 0 local const = item2.itemid function onUse(cid, item, frompos, item2, topos) if item[const] then local random_item = math.random(1, 100) for i = 1, #item[const] do if random_item <= item[const][i].opportunity then developed = i end end if developed > 0 then doSendMagicEffect(topos, 28) doRemoveItem(item.uid,1) doTransformItem(item2.uid, item[const][developed].id) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have renewed the ".. item[const][developed].name .." !") else doSendMagicEffect(topos, 3) doRemoveItem(item.uid,1) doRemoveItem(item2.uid, 1) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your Rusty Remover has broken.") return false end doRemoveItem(item.uid,1) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Use it on Rusty Items (Common, Semi-Rare or Rare: Armors, Legs, helmets, boots or shields).") return false end return false end Aguardo resposta do teste .. STYLLER OT 2022
Postado Maio 4, 2014 11 anos PQ em sua script tá assim:: doPlayerRemoveItem Claro que essa função só vai remove o Item do Player quando estive com ele, no caso quando estiver no chão não vai remove. Troque todos doPlayerRemoveItem por doRemoveItem no caso desse aqui ele Vai remover o item mesmo no Chão! Editado Maio 4, 2014 11 anos por Wreymar (veja o histórico de edições)
Postado Maio 4, 2014 11 anos Autor luanluciano93 tentei seu script aqui, mas deu o seguinte erro no servidor: [4/5/2014 11:3:35] [Error - Test Interface] [4/5/2014 11:3:35] data/actions/scripts/tools/rust remover.lua [4/5/2014 11:3:35] Description: [4/5/2014 11:3:35] data/actions/scripts/tools/rust remover.lua:131: attempt to index global 'item2' (a nil value) [4/5/2014 11:3:36] [Error - Event::checkScript] Cannot load script (data/actions/scripts/tools/rust remover.lua) Dei uma melhorada no script, mas ainda não continua removendo o item do chão. Dá uma olhada: function onUse(cid, item, frompos, item2, topos) local effect_broke = 3 local effect_renew = 28 local developed = 0 local const = item2.itemid local pos = getCreaturePosition(cid) local item = { [9808] = { [1] = {id = 2464, name = "Chain Armor", opportunity = 33}, [2] = {id = 2483, name = "Scale Armor", opportunity = 25}, [3] = {id = 2465, name = "Brass Armor", opportunity = 10}, [4] = {id = 2463, name = "Plate Armor", opportunity = 2} }, [9809] = { [1] = {id = 2464, name = "Chain Armor", opportunity = 16}, [2] = {id = 2465, name = "Brass Armor", opportunity = 14}, [3] = {id = 2483, name = "Scale Armor", opportunity = 13}, [4] = {id = 2463, name = "Plate Armor", opportunity = 10}, [5] = {id = 2476, name = "Knight Armor", opportunity = 6}, [6] = {id = 8891, name = "Paladin Armor", opportunity = 3}, [7] = {id = 2487, name = "Crown Armor", opportunity = 1} }, [9810] = { [1] = {id = 2464, name = "Chain Armor", opportunity = 20}, [2] = {id = 2465, name = "Brass Armor", opportunity = 17}, [3] = {id = 2483, name = "Scale Armor", opportunity = 15}, [4] = {id = 2463, name = "Plate Armor", opportunity = 12}, [5] = {id = 2476, name = "Knight Armor", opportunity = 10}, [6] = {id = 8891, name = "Paladin Armor", opportunity = 5}, [7] = {id = 2487, name = "Crown Armor", opportunity = 4}, [8] = {id = 2466, name = "Golden Armor", opportunity = 2}, [9] = {id = 2472, name = "Magic Plate Armor", opportunity = 1} }, [9811] = { [1] = {id = 2468, name = "Studded Legs", opportunity = 33}, [2] = {id = 2648, name = "Chain Legs", opportunity = 25}, [3] = {id = 2478, name = "Brass Legs", opportunity = 10}, [4] = {id = 2647, name = "Plate Legs", opportunity = 2} }, [9812] = { [1] = {id = 2468, name = "Studded Legs", opportunity = 16}, [2] = {id = 2648, name = "Chain Legs", opportunity = 14}, [3] = {id = 2478, name = "Brass Legs", opportunity = 13}, [4] = {id = 2647, name = "Plate Legs", opportunity = 10}, [5] = {id = 2477, name = "Knight Legs", opportunity = 6}, [7] = {id = 2488, name = "Crown Legs", opportunity = 1} }, [9813] = { [2] = {id = 2478, name = "Brass Legs", opportunity = 17}, [4] = {id = 2647, name = "Plate Legs", opportunity = 12}, [5] = {id = 2477, name = "Knight Legs", opportunity = 10}, [7] = {id = 2488, name = "Crown Legs", opportunity = 4}, [8] = {id = 2470, name = "Golden Legs", opportunity = 2} }, [9814] = { [10] = {id = 2511, name = "Brass Shield", opportunity = 16}, [11] = {id = 2510, name = "Plate Shield", opportunity = 14}, [12] = {id = 2530, name = "Cooper Shield", opportunity = 13}, [13] = {id = 2509, name = "Steel Shield", opportunity = 10}, [14] = {id = 2513, name = "Battle Shield", opportunity = 6}, [15] = {id = 2515, name = "Guardian Shield", opportunity = 1} }, [9815] = { [10] = {id = 2511, name = "Brass Shield", opportunity = 20}, [11] = {id = 2510, name = "Plate Shield", opportunity = 17}, [12] = {id = 2530, name = "Cooper Shield", opportunity = 15}, [13] = {id = 2509, name = "Steel Shield", opportunity = 12}, [14] = {id = 2513, name = "Battle Shield", opportunity = 10}, [15] = {id = 2515, name = "Guardian Shield", opportunity = 5}, [16] = {id = 2516, name = "Dragon Shield", opportunity = 2}, [17] = {id = 2519, name = "Crown Shield", opportunity = 1} }, [9816] = { [10] = {id = 2511, name = "Brass Shield", opportunity = 20}, [11] = {id = 2510, name = "Plate Shield", opportunity = 17}, [12] = {id = 2530, name = "Cooper Shield", opportunity = 15}, [13] = {id = 2509, name = "Steel Shield", opportunity = 13}, [14] = {id = 2513, name = "Battle Shield", opportunity = 11}, [15] = {id = 2515, name = "Guardian Shield", opportunity = 8}, [16] = {id = 2516, name = "Dragon Shield", opportunity = 6}, [17] = {id = 2519, name = "Crown Shield", opportunity = 4}, [18] = {id = 2520, name = "Demon Shield", opportunity = 2}, [19] = {id = 2514, name = "Mastermind Shield", opportunity = 1} }, [9817] = { [20] = {id = 2643, name = "Leather Boots", opportunity = 33}, [21] = {id = 3982, name = "Crocodile Boots", opportunity = 25}, [22] = {id = 5462, name = "Pirate Boots", opportunity = 10}, [23] = {id = 7457, name = "Fur Boots", opportunity = 2} }, [9818] = { [20] = {id = 2643, name = "Leather Boots", opportunity = 17}, [21] = {id = 3982, name = "Crocodile Boots", opportunity = 12}, [22] = {id = 5462, name = "Pirate Boots", opportunity = 10}, [23] = {id = 7457, name = "Fur Boots", opportunity = 4}, [24] = {id = 2195, name = "Boots of Haste", opportunity = 2} }, [9819] = { [20] = {id = 2643, name = "Leather Boots", opportunity = 16}, [21] = {id = 3982, name = "Crocodile Boots", opportunity = 14}, [22] = {id = 5462, name = "Pirate Boots", opportunity = 13}, [23] = {id = 7457, name = "Fur Boots", opportunity = 10}, [24] = {id = 2195, name = "Boots of Haste", opportunity = 6}, [25] = {id = 2645, name = "Steel Boots", opportunity = 1} }, [9820] = { [26] = {id = 2458, name = "Chain Helmet", opportunity = 16}, [27] = {id = 2460, name = "Brass Helmet", opportunity = 14}, [28] = {id = 2480, name = "Legion Helmet", opportunity = 13}, [29] = {id = 2481, name = "Soldier Helmet", opportunity = 10}, [30] = {id = 2457, name = "Steel Helmet", opportunity = 6}, [31] = {id = 2491, name = "Crown Helmet", opportunity = 1} }, [9821] = { [26] = {id = 2458, name = "Chain Helmet", opportunity = 16}, [27] = {id = 2460, name = "Brass Helmet", opportunity = 14}, [28] = {id = 2480, name = "Legion Helmet", opportunity = 13}, [29] = {id = 2481, name = "Soldier Helmet", opportunity = 10}, [30] = {id = 2457, name = "Steel Helmet", opportunity = 6}, [31] = {id = 2491, name = "Crown Helmet", opportunity = 2}, [32] = {id = 2497, name = "Crusader Helmet", opportunity = 1} }, [9822] = { [26] = {id = 2458, name = "Chain Helmet", opportunity = 20}, [27] = {id = 2460, name = "Brass Helmet", opportunity = 15}, [28] = {id = 2480, name = "Legion Helmet", opportunity = 13}, [29] = {id = 2481, name = "Soldier Helmet", opportunity = 11}, [30] = {id = 2457, name = "Steel Helmet", opportunity = 8}, [31] = {id = 2491, name = "Crown Helmet", opportunity = 6}, [32] = {id = 2497, name = "Crusader Helmet", opportunity = 4}, [33] = {id = 2475, name = "Warrior Helmet", opportunity = 2}, [34] = {id = 2498, name = "Royal Helmet", opportunity = 1} } } if item[const] then local random_item = math.random(1, 100) for i = 1, #item[const] do if random_item <= item[const].opportunity then developed = i end end if developed > 0 then doSendMagicEffect(topos, effect_renew) doTransformItem(item2.uid, item[const][developed].id) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have renewed the ".. item[const][developed].name .." !") doPlayerRemoveItem(cid, 9930, 1) else doSendMagicEffect(topos, effect_broke) doRemoveItem(item2.uid, 1) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your Rusty Remover has broken.") doPlayerRemoveItem(cid, 9930, 1) return false enddoRemoveItem(cid, 9930, 1) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Use it on Rusty Items (Common, Semi-Rare or Rare: Armors, Legs, helmets, boots or shields).") return false end return true end E Wreymar, não acha que já tentei isso parceiro... é algo mais complexo e chato de resolver. Modificando doPlayerRemoveItem por doRemoveItem o item 9930 (rust remover) ainda fica infinito no chão e não é removido, além de dar erro no servidor (LuaInterface::luaDoRemoveItem) Item not found. *Lembro que meu actions.xml está assim: <action itemid="9930" event="script" value="tools/rust remover.lua"/> *Não teríamos que colocar o item 9930 dentro do sctipt? Editado Maio 4, 2014 11 anos por lagoa (veja o histórico de edições) Te Ajudei? Rep+
Postado Maio 4, 2014 11 anos Acho que você fez algo errado ao coloca me script, pois esta dando erro na linha 131, e o que eu modifiquei não vai até essa linha, o seu sim! STYLLER OT 2022
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.