Postado Julho 14, 2022 2 anos Olá pessoal bom dia, Estou com o seguinte problema, possuo um sistema que ao clicar no crystal da sua x vocação o player ganha x spell. Porem o problema está na hora do player clicar na estatua da sua vocação e não ganhar a spell. Dizendo que não é a estatua da vocação dele... "Crystal errado, procure da sua vocação!"... Já testei com todas as vocações e nada, continua dizendo a msg acima. Segue o script do Crystal que verifica a vocação do player... Spoiler local magias = { [1] = "zesshou hachimon", [2] = "jukai kousan", [3] = "mugen shiki", [4] = "yahumuki", [5] = "zesshou hachimon", [6] = "jukai kousan", [7] = "mugen shiki", [8] = "yahumuki", [9] = "zesshou hachimon", [10] = "jukai kousan", [11] = "mugen shiki", [12] = "yahumuki" } function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerGroupId(cid) > 2 and getPlayerGroupId(cid) < 5 then return true end local voc = getPlayerVocation(cid) local gem = gems.id[voc] if item.actionid == gem then if getPlayerLevel(cid) < 450 then doCreatureSay(cid,"É necessário level 450 ou maior para absorver á técnica espiritual!",TALKTYPE_ORANGE_1) doSendMagicEffect(getThingPos(cid), 2) return true elseif getPlayerStorageValue(cid, 21202) > 0 then doCreatureSay(cid,"Você só consegue obsorver á técnica ("..magias[voc]..") do cystal, se não tiver com carga em você!",TALKTYPE_ORANGE_1) doSendMagicEffect(getThingPos(cid), 2) return true end setPlayerStorageValue(cid, 21202,1) setPlayerStorageValue(cid, gems.storage[voc], 1) doUseGem(cid, item) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"Parabéns, você absorveu a técnica ("..magias[voc]..") com (1x) carga aproveite!") doSendMagicEffect(getPlayerPosition(cid), 65) return true else doCreatureSay(cid,"Crystal errado, procure da sua vocação!",TALKTYPE_ORANGE_1) doSendMagicEffect(getThingPos(cid), 2) return true end return true end Lib Spoiler gems = { id = {8635, 8636, 8633, 8634, 8635, 8636, 8633, 8634, 8635, 8636, 8633, 8634}, storage = {5001, 5002, 5003, 5004, 5005, 5006, 5007, 5008, 5009, 5010, 5011, 5012}, interval = {800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800} } gemMsg = { rnd = {"´ . ,", ". ´ ,", "` . ,", ", ´ ."}, class_color = { [1] = {180,180}, [2] = {30,215}, [3] = {251,10}, [4] = {204,212}, [5] = {180,180}, [6] = {30,215}, [7] = {251,10}, [8] = {204,212}, [9] = {180,180}, [10] = {30,215}, [11] = {251,10}, [12] = {204,212} } } function doRemoveGemEffect(cid) local voc = getPlayerVocation(cid) setPlayerStorageValue(cid, gems.storage[voc], 0) end function doUseGem(cid, item) local voc = getPlayerVocation(cid) local interval = gems.interval[voc] sendGemEffect(cid, gems.storage[voc], gems.interval[voc]) return true end function sendGemEffect(cid, storage, interval) if not isCreature(cid) then return LUA_ERROR end local pos = getThingPos(cid) local voc = getPlayerVocation(cid) local color = 1 local var = gemMsg.class_color[voc] if getPlayerLevel(cid) < 450 or not var or not isGemActivated(cid) then return true end local color = var[math.random(1,#var)] doSendAnimatedText(pos, gemMsg.rnd[math.random(1,#gemMsg.rnd)], color) if isGemActivated(cid) then addEvent(sendGemEffect, interval, cid, storage, interval) end end function doRemoveAllGemEffect(cid) for i = 1, table.maxn(gms.storage) do setPlayerStorageValue(cid, gems.storage[i], 0) end return true end function isGemActivated(cid) local voc = getPlayerVocation(cid) return getPlayerStorageValue(cid, gems.storage[voc]) > 0 and true or false end Eu utilizo OTX 2 - 8.6 Muito obrigado desde já. @Vodkart que refez este script para min na época. VENHAM JOGAR O MELHOR BAIAK JÁ CRIADO DE 2022!! CRIE SUA CONTA AGORA MESMO! www.baiakudo.com
Postado Julho 14, 2022 2 anos Solução 7 horas atrás, DeathRocks disse: local gem = gems.id[voc] coloca um print(gem) pra ver oq mostra no console e manda uma print. e o action ID das estatuas está certo? estatua1 = action id: 8635 estatua2 = action id: 8636 estatua3 = action id: 8633 ....
Postado Julho 15, 2022 2 anos Autor 14 horas atrás, FeeTads disse: coloca um print(gem) pra ver oq mostra no console e manda uma print. e o action ID das estatuas está certo? estatua1 = action id: 8635 estatua2 = action id: 8636 estatua3 = action id: 8633 .... Problema resolvido, eram as actions erradas... VENHAM JOGAR O MELHOR BAIAK JÁ CRIADO DE 2022!! CRIE SUA CONTA AGORA MESMO! www.baiakudo.com
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.