Postado Dezembro 11, 2021 3 anos Eae pessoal beleza, estou com um problema aqui que quando eu falo !saga com um numero com ponto e outro numero o player fica invisivel Citar não coloquei todas voc ainda porque reparei esse bug e não achei solução !saga 1.2 foi testado em uma voc q ja esta no script q é o sasuke não tem erro na distro, alguem me ajuda pfv. talkaction/scripts/saga.lua Citar local saga = { -- Naruto -- [1] = {840,91,841,676,842,40,305,677,686,179,683,397,607,752,875}, -- [ID DA VOC] = { ID DAS NEWTYPES }, -- Sasuke -- [17] = {93,689,690,658,659,660,661,654,663,873}, -- [ID DA VOC] = { ID DAS NEWTYPES }, } local level = 20 -- Limite para liberar uma saga nova function onSay(cid, words, param, channel) if exhaustion.check(cid, 120) == TRUE then doPlayerSendCancel(cid, "You are exhausted.") doSendMagicEffect(getCreaturePosition(cid), 3) return TRUE end if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o numero da saga que voce deseja.") exhaustion.set(cid, 120, 0.5) return true end if not saga[getPlayerVocation(cid)] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao pode trocar de saga.") exhaustion.set(cid, 120, 0.5) return true end local t = string.explode(param, ",") if(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Could not understand.") return true end if not (tonumber(t[1])) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o numero da saga que voce deseja.") exhaustion.set(cid, 120, 0.5) return true end if tonumber(t[1]) > #saga[getPlayerVocation(cid)] or tonumber(t[1]) < 1 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Essa saga nao existe.") exhaustion.set(cid, 120, 0.5) return true end if getPlayerLevel(cid) >= (tonumber(t[1])*level) then doCreatureChangeOutfit(cid, {lookType = saga[getPlayerVocation(cid)][tonumber(t[1])]}) doSendMagicEffect(getThingPos(cid), saga[getPlayerVocation(cid)].effect) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "voce escolheu uma nova saga!") doPlayerSay(cid, "Saga!!", TALKTYPE_ORANGE_1) exhaustion.set(cid, 120, 0.5) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, voce precisa de level "..(tonumber(t[1]) * level).." usar essa saga.") end return true end Editado Dezembro 11, 2021 3 anos por Gabrielx17 (veja o histórico de edições)
Postado Dezembro 13, 2021 3 anos Autor Solução Citar local saga = { -- Naruto -- [1] = {840,91,841,676,842,40,305,677,686,179,683,397,607,752,875}, -- [ID DA VOC] = { ID DAS NEWTYPES }, -- Sasuke -- [17] = {93,689,690,658,659,660,661,654,663,873}, -- [ID DA VOC] = { ID DAS NEWTYPES }, } local level = 20 -- Limite para liberar uma saga nova function onSay(cid, words, param, channel) if exhaustion.check(cid, 120) == TRUE then doPlayerSendCancel(cid, "You are exhausted.") doSendMagicEffect(getCreaturePosition(cid), 3) return TRUE end if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o numero da saga que voce deseja.") exhaustion.set(cid, 120, 0.5) return true end if not saga[getPlayerVocation(cid)] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao pode trocar de saga.") exhaustion.set(cid, 120, 0.5) return true end local t = string.explode(param, ",") if(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "esse numero de saga nao existe.") return true end local ta = string.explode(param, ".") if(ta[3]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "esse numero de saga nao existe.") return true end if not (tonumber(t[1])) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o numero da saga que voce deseja.") exhaustion.set(cid, 120, 0.5) return true end if tonumber(t[1]) > #saga[getPlayerVocation(cid)] or tonumber(t[1]) < 1 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Essa saga nao existe.") exhaustion.set(cid, 120, 0.5) return true end if getPlayerLevel(cid) >= (tonumber(t[1])*level) then doCreatureChangeOutfit(cid, {lookType = saga[getPlayerVocation(cid)][tonumber(t[1])]}) doSendMagicEffect(getThingPos(cid), saga[getPlayerVocation(cid)].effect) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "voce escolheu uma nova saga!") doPlayerSay(cid, "Saga!!", TALKTYPE_ORANGE_1) exhaustion.set(cid, 120, 0.5) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, voce precisa de level "..(tonumber(t[1]) * level).." usar essa saga.") end return true end Solucionado em verde a linha adicionada. Editado Dezembro 13, 2021 3 anos por Gabrielx17 solucionei (veja o histórico de edições)
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.