Postado Janeiro 31, 2017 8 anos Qual base você usa? Diga onde você baixou para me ver, o erro não é no script amigo. Pode ser no MOD ou em alguma talkaction (se for como o MOD de shop)
Postado Janeiro 31, 2017 8 anos Autor Esse post é a base, eu baixei ai, O Script abriu normal com este código: function onSay(cid, words, param, channel) if not isCreature(cid) then return true end devotedCount = getPlayerItemCount(cid, devotedToken) mightyCount = getPlayerItemCount(cid, mightyToken) honoredCount = getPlayerItemCount(cid, honoredToken) if words == "#devoted#" then if devotedCount >= 20 then if math.random(1,2) == 1 then tierTable = helds.tiers1 else tierTable = helds.tiers2 end prize = tierTable[math.random(#tierTable)] doPlayerAddItem(cid, prize, 1) doPlayerRemoveItem(cid, DevotedToken, 20) doPlayerSendTextMessage(cid, 19, "You received a "..getItemInfo(prize).name..".") doCreatureExecuteTalkAction(cid, "#heldCount#") return true else doPlayerSendTextMessage(cid, 27, "You need 20 Devoted Tokens to pick a held item!") doCreatureExecuteTalkAction(cid, "#heldCount#") return true end return true end if words == "#mighty1#" then if mightyCount >= 50 then if math.random(1,3) == 1 then tierTable = helds.tiers1 elseif math.random(1,3) == 2 then tierTable = helds.tiers2 else tierTable = helds.tiers3 end prize = tierTable[math.random(#tierTable)] doPlayerAddItem(cid, prize, 1) doPlayerRemoveItem(cid, mightyToken, 50) doPlayerSendTextMessage(cid, 19, "You received a "..getItemInfo(prize).name..".") doCreatureExecuteTalkAction(cid, "#heldCount#") return true else doPlayerSendTextMessage(cid, 27, "You need 50 Mighty Tokens to pick a held item!") doCreatureExecuteTalkAction(cid, "#heldCount#") return true end end if words == "#mighty2#" then if mightyCount >= 100 then if math.random(1,3) == 1 then tierTable = helds.tiers2 elseif math.random(1,3) == 2 then tierTable = helds.tiers3 else tierTable = helds.tiers4 end prize = tierTable[math.random(#tierTable)] doPlayerAddItem(cid, prize, 1) doPlayerRemoveItem(cid, mightyToken, 100) doPlayerSendTextMessage(cid, 19, "You received a "..getItemInfo(prize).name..".") doCreatureExecuteTalkAction(cid, "#heldCount#") return true else doPlayerSendTextMessage(cid, 27, "You need 100 Mighty Tokens to pick a held item!") doCreatureExecuteTalkAction(cid, "#heldCount#") return true end end if words == "#mighty3#" then if mightyCount >= 200 then if math.random(1,4) == 1 then tierTable = helds.tiers3 elseif math.random(1,4) == 2 then tierTable = helds.tiers4 elseif math.random(1,4) == 3 then tierTable = helds.tiers5 else tierTable = helds.tiers6 end prize = tierTable[math.random(#tierTable)] doPlayerAddItem(cid, prize, 1) doPlayerRemoveItem(cid, mightyToken, 200) doPlayerSendTextMessage(cid, 19, "You received a "..getItemInfo(prize).name..".") doCreatureExecuteTalkAction(cid, "#heldCount#") return true else doPlayerSendTextMessage(cid, 27, "You need 200 Mighty Tokens to pick a held item!") doCreatureExecuteTalkAction(cid, "#heldCount#") return true end end if words == "#honored1#" then if honoredCount >= 25 then if math.random(1,3) == 1 then tierTable = helds.tiers1 elseif math.random(1,3) == 2 then tierTable = helds.tiers2 else tierTable = helds.tiers3 end prize = tierTable[math.random(#tierTable)] doPlayerAddItem(cid, prize, 1) doPlayerRemoveItem(cid, honoredToken, 25) doPlayerSendTextMessage(cid, 19, "You received a "..getItemInfo(prize).name..".") doCreatureExecuteTalkAction(cid, "#heldCount#") return true else doPlayerSendTextMessage(cid, 27, "You need 25 Honored Tokens to pick a held item!") doCreatureExecuteTalkAction(cid, "#heldCount#") return true end end if words == "#honored2#" then if honoredCount >= 50 then if math.random(1,3) == 1 then tierTable = helds.tiers2 elseif math.random(1,3) == 2 then tierTable = helds.tiers3 else tierTable = helds.tiers4 end prize = tierTable[math.random(#tierTable)] doPlayerAddItem(cid, prize, 1) doPlayerRemoveItem(cid, honoredToken, 50) doPlayerSendTextMessage(cid, 19, "You received a "..getItemInfo(prize).name..".") doCreatureExecuteTalkAction(cid, "#heldCount#") return true else doPlayerSendTextMessage(cid, 27, "You need 50 Honored Tokens to pick a held item!") doCreatureExecuteTalkAction(cid, "#heldCount#") return true end end if words == "#honored3#" then if honoredCount >= 100 then if math.random(1,4) == 1 then tierTable = helds.tiers3 elseif math.random(1,4) == 2 then tierTable = helds.tiers4 elseif math.random(1,4) == 3 then tierTable = helds.tiers5 else tierTable = helds.tiers6 end prize = tierTable[math.random(#tierTable)] doPlayerAddItem(cid, prize, 1) doPlayerRemoveItem(cid, honoredToken, 100) doPlayerSendTextMessage(cid, 19, "You received a "..getItemInfo(prize).name..".") doCreatureExecuteTalkAction(cid, "#heldCount#") return true else doPlayerSendTextMessage(cid, 27, "You need 100 Honored Tokens to pick a held item!") doCreatureExecuteTalkAction(cid, "#heldCount#") return true end end if words == "#heldCount#" then doPlayerSendCancel(cid, "#held#,"..devotedCount..","..mightyCount..","..honoredCount..",") return true end return true end Mas o que acontece é que ele fala que não tenho os itens em minha bolsa.. ∞ Gregorio, HaxYu Corporation Of Technology
Postado Janeiro 31, 2017 8 anos É em algum MOD do OTC mesmo amigo, estarei baixando o OTClient aqui para ver
Postado Janeiro 31, 2017 8 anos Autor Ok! Com o script original ele carregou normal, só que quando eu clico em trocar o token pelo held aparece isso: [31/01/2017 15:24:40] [Error - TalkAction Interface] [31/01/2017 15:24:40] data/talkactions/scripts/otc held.lua:onSay [31/01/2017 15:24:40] Description: [31/01/2017 15:24:40] data/talkactions/scripts/otc held.lua:10: attempt to index global 'helds' (a nil value) [31/01/2017 15:24:40] stack traceback: [31/01/2017 15:24:40] data/talkactions/scripts/otc held.lua:10: in function <data/talkactions/scripts/otc held.lua:1> ∞ Gregorio, HaxYu Corporation Of Technology
Postado Janeiro 31, 2017 8 anos 1 hora atrás, Shinob disse: Ok! Com o script original ele carregou normal, só que quando eu clico em trocar o token pelo held aparece isso: [31/01/2017 15:24:40] [Error - TalkAction Interface] [31/01/2017 15:24:40] data/talkactions/scripts/otc held.lua:onSay [31/01/2017 15:24:40] Description: [31/01/2017 15:24:40] data/talkactions/scripts/otc held.lua:10: attempt to index global 'helds' (a nil value) [31/01/2017 15:24:40] stack traceback: [31/01/2017 15:24:40] data/talkactions/scripts/otc held.lua:10: in function <data/talkactions/scripts/otc held.lua:1> Troque o script por esse ai: local a = { ITEM = {14752, 20}, ITEM2 = {14723, 1}, ITEM3 = {14750, 50}, ITEM4 = {14724, 1}, ITEM5 = {14750, 100}, ITEM6 = {14725, 1}, ITEM7 = {14750, 200}, ITEM8 = {14726, 1}, ITEM9 = {14751, 25}, ITEM10 = {14727, 1}, ITEM11 = {14751, 50}, ITEM12 = {14728, 1}, ITEM13 = {14751, 100}, ITEM14 = {14729, 1}, } function onSay(cid, words, param, channel) mightyCount = getPlayerItemCount(cid, mightyToken) honoredCount = getPlayerItemCount(cid, honoredToken) if words == "#devoted#" then if getPlayerItemCount(cid, a.ITEM[1]) >= a.ITEM[2] then doPlayerAddItem(cid, a.ITEM2[1], a.ITEM2[2]) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce recebeu um item!") doSendMagicEffect(getCreaturePosition(cid), 28) doPlayerRemoveItem(cid, a.ITEM[1], a.ITEM[2]) else doSendMagicEffect(getCreaturePosition(cid), 2) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Desculpe.") end return TRUE end if words == "#mighty1#" then if getPlayerItemCount(cid, a.ITEM3[1]) >= a.ITEM3[2] then doPlayerAddItem(cid, a.ITEM4[1], a.ITEM4[2]) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce recebeu um item!") doSendMagicEffect(getCreaturePosition(cid), 28) doPlayerRemoveItem(cid, a.ITEM3[1], a.ITEM3[2]) else doSendMagicEffect(getCreaturePosition(cid), 2) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Desculpe.") end return TRUE end if words == "#mighty2#" then if getPlayerItemCount(cid, a.ITEM5[1]) >= a.ITEM5[2] then doPlayerAddItem(cid, a.ITEM6[1], a.ITEM6[2]) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce recebeu um item!") doSendMagicEffect(getCreaturePosition(cid), 28) doPlayerRemoveItem(cid, a.ITEM5[1], a.ITEM5[2]) else doSendMagicEffect(getCreaturePosition(cid), 2) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Desculpe.") end return TRUE end if words == "#mighty3#" then if getPlayerItemCount(cid, a.ITEM7[1]) >= a.ITEM7[2] then doPlayerAddItem(cid, a.ITEM8[1], a.ITEM8[2]) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce recebeu um item!") doSendMagicEffect(getCreaturePosition(cid), 28) doPlayerRemoveItem(cid, a.ITEM7[1], a.ITEM7[2]) else doSendMagicEffect(getCreaturePosition(cid), 2) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Desculpe.") end return TRUE end if words == "#honored1#" then if getPlayerItemCount(cid, a.ITEM9[1]) >= a.ITEM9[2] then doPlayerAddItem(cid, a.ITEM10[1], a.ITEM10[2]) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce recebeu um item!") doSendMagicEffect(getCreaturePosition(cid), 28) doPlayerRemoveItem(cid, a.ITEM9[1], a.ITEM9[2]) else doSendMagicEffect(getCreaturePosition(cid), 2) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Desculpe.") end return TRUE end if words == "#honored2#" then if getPlayerItemCount(cid, a.ITEM11[1]) >= a.ITEM11[2] then doPlayerAddItem(cid, a.ITEM12[1], a.ITEM12[2]) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce recebeu um item!") doSendMagicEffect(getCreaturePosition(cid), 28) doPlayerRemoveItem(cid, a.ITEM11[1], a.ITEM11[2]) else doSendMagicEffect(getCreaturePosition(cid), 2) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Desculpe.") end return TRUE end if words == "#honored3#" then if getPlayerItemCount(cid, a.ITEM13[1]) >= a.ITEM13[2] then doPlayerAddItem(cid, a.ITEM14[1], a.ITEM14[2]) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce recebeu um item!") doSendMagicEffect(getCreaturePosition(cid), 28) doPlayerRemoveItem(cid, a.ITEM13[1], a.ITEM13[2]) else doSendMagicEffect(getCreaturePosition(cid), 2) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Desculpe.") end return TRUE end return true end Esse script original do servidor está cheio de gambiarra junto com o MOD! Ai alterei ele quase todo para funcionar normal, teste ai
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.