Postado Outubro 21, 2017 7 anos local saga = { [1] = {[1] = 180, [2] = 438, [3] = 182, effect = 10}, --[Vocation] = {[1] = Roupa, effect = Efeito da transformação} [2] = {[1] = 64, effect = 10} --TESTE } local level = 25 -- Limite para liberar uma saga nova function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o número da saga que você deseja.") return true end if not saga[getPlayerVocation(cid)] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao pode trocar de saga.") 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 número da saga que você deseja.") return true end if tonumber(t[1]) > #saga[getPlayerVocation(cid)] or tonumber(t[1]) < 1 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Essa saga não existe.") return true end if getPlayerLevel(cid) >= (tonumber(t[1])*level) then doSetCreatureOutfit(cid, {lookType = saga[getPlayerVocation(cid)][tonumber(t[1])]}, -1) doSendMagicEffect(getThingPos(cid), saga[getPlayerVocation(cid)].effect) doPlayerSendTextMessage(cid, 25, "Voce escolheu uma nova saga!") doPlayerSay(cid, "Saga!!", TALKTYPE_ORANGE_1) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, você precisa de level "..(tonumber(t[1]) * level).." usar essa saga.") end return true end Bom o comando funciona se um jogador usar !saga 1 ele muda a saga, só que se alguem usar !saga 1.2 o personagem fica com o looktype de ghost, alguém teria alguma solução como proibir o . na talkaction ou alguma outra solução para não usarem o numero seguido do ponto. Tfs 0.4 @vankk @Dwarfer @Vodkart @Wakon Editado Outubro 21, 2017 7 anos por One Punch Man (veja o histórico de edições)
Postado Outubro 21, 2017 7 anos Solução Mostrar conteúdo oculto local saga = { [1] = {[1] = 180, [2] = 438, [3] = 182, effect = 10}, --[Vocation] = {[1] = Roupa, effect = Efeito da transformação} [2] = {[1] = 64, effect = 10} --TESTE } local level = 25 -- Limite para liberar uma saga nova function onSay(cid, words, param, channel) if(param == '' or not tonumber(param)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o número da saga que você deseja.") return true end local voc = saga[getPlayerVocation(cid)] if not voc then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao pode trocar de saga.") return true end if not voc[tonumber(param)] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Essa saga não existe.") return true end if getPlayerLevel(cid) < tonumber(param) * level then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, você precisa de level "..(tonumber(param) * level).." para usar essa saga.") return true end doSetCreatureOutfit(cid, {lookType = voc[tonumber(param)]}, -1) doSendMagicEffect(getThingPos(cid), voc.effect) doPlayerSendTextMessage(cid, 25, "Voce escolheu uma nova saga!") doPlayerSay(cid, "Saga!!", TALKTYPE_ORANGE_1) return true end Contato: Email: dwarfer@sapo.pt Discord: Dwarfer#2715
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.