Postado Fevereiro 24, 2018 7 anos Olá, Estou criando um narutibia, o erro dessa script de !saga (transforma o player ex: !saga 1 = 1 transformação) é que está deixando o player invisivel ao utilizar !saga 1.x ex : saga 1.2, Eu quero que caso o player utilize o !saga 1.x, De que essa transformação não existe, que de apenas para transformar com números inteiros! local saga = { [1] = {400,401,402,403,404,405,406,407,408,409,410,411,412,413,398}, -- [ID DA VOC] = { ID DAS NEWTYPES }, [700] = {418,419,420,421,422,423,424,426,428,436,430,431,435,433} } local level = 25 -- 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 número da saga que você 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 número da saga que você 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 não 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, você precisa de level "..(tonumber(t[1]) * level).." usar essa saga.") end return true end Naruto Age of Darkness (Naruto World)
Postado Fevereiro 28, 2018 7 anos Solução Cara, tem coisa estranha nesse código, além de tá horrível para interpretar... Mas ok, tentarei te ajudar, me informe o que mostra no jogo se o cara digita 1.x (que você quer remover). Editado Março 1, 2018 7 anos por lordzetros (veja o histórico de edições) Feliz daquele que ensina o que sabe, e aprende o que ensina.
Postado Março 1, 2018 7 anos Autor Em 28/02/2018 em 15:04, lordzetros disse: Cara, tem coisa estranha nesse código, além de tá horrível para interpretar... Mas ok, tentarei te ajudar, me informe o que mostra no jogo se o cara digita 1.x (que você quer remover), e também remove o # dessa parte do código: if tonumber(t[1]) > #saga[getPlayerVocation(cid)] or tonumber(t[1]) < 1 then Eu consegui resolver, Eu tambem fiz um topico de uma spell se você poder dar uma ajudada lá, vlw ai por ajudar! -- <talkaction words="!saga; /saga; /transformar; !transformar" event="script" value="saga.lua"/> local saga = { [1] = {471,401,402,472,473,405,406,470,408,409,410,411,412,413,398}, -- [ID DA VOC] = { ID DAS NEWTYPES }, [700] = {469,468,458,459,460,464,465,436,430,466,467}, [710] = {475,476,477,478,479,480,481,482,483,484,485,484} } local level = 5 -- 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 número da saga que você 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 número da saga que você 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 não 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, você precisa de level "..(tonumber(t[1]) * level).." usar essa saga.") end return true end Pra quem quiser a script tá ai, aqui funcionou normal Editado Março 1, 2018 7 anos por felippepsa (veja o histórico de edições) Naruto Age of Darkness (Naruto World)
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.