Ir para conteúdo
  • 0

[Resolvido] [Saga System] Script pedir uma storage antes de transformar


LeoTK

Pergunta

Fala guys será que alguém pode me ajudar a editar o script saga para transformar gostaria que ele pedisse level e storage igual ele pede a id da outfit ou sejá que ficasse configuravel no caso toda vez que ele mudar a transformar necessitar de uma storage

 

local saga = {[1] = {[1] = 71, [2] = 66, [3] = 91, [4] = 18, [5] = 31, [6] = 92, [7] = 40, [8] = 49, [9] = 25, [10] = 179, [11] = 952, [12] = 951, [13] = 291, [14] = 302, [15] = 487, [16] = 54, [17] = 743, [18] = 1000, [19] = 1001, [20] = 954, [21] = 955, [22] = 953, effect = 111}, --[Vocation] = {[1] = Roupa, effect = Efeito da transformação}[2] = {[1] = 64, effect = 10} --TESTE}local level = 36 -- Limite para liberar uma saga novafunction onSay(cid, words, param, channel) if(param == '') then  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o numero da saga que voce deseja.")  return true endif not saga[getPlayerVocation(cid)] thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao pode trocar de saga.")return trueendlocal 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.")  return true endif tonumber(t[1]) > #saga[getPlayerVocation(cid)] or tonumber(t[1]) < 1  thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Essa saga nao existe.")return trueendif getPlayerLevel(cid) >= (tonumber(t[1])*level) thendoSetCreatureOutfit(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)elsedoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, voce precisa de level "..(tonumber(t[1]) * level).." usar essa saga.")endreturn trueend

no caso ficando assim

 

local saga = {
[1] = {[1] = roupa, level, storage [2] = 66, [3] = 91, [4] = 18, [5] = 31, [6] = 92, [7] = 40, [8] = 49, [9] = 25, [10] = 179, [11] = 952, [12] = 951, [13] = 291, [14] = 302, [15] = 487, [16] = 54, [17] = 743, [18] = 1000, [19] = 1001, [20] = 954, [21] = 955, [22] = 953, effect = 111},

--[Vocation] = {[1] = Level, Storage, Roupa,effect = Efeito da transformação}

Ele vai verificar a vocação o level ai se o player tem a storage caso tiver tudo isso ele muda a roupa fazendo o efeito só precisava dessa alteração

 

se alguém puder me ajudar a fazer isso ficarei extremamente agradecido

Editado por Poccnn
Link para o comentário
Compartilhar em outros sites

Posts Recomendados

  • 0
local saga = {[1] = {[1] = 71, level = XXXX, storage = YYYY, [2] = 66, [3] = 91, [4] = 18, [5] = 31, [6] = 92, [7] = 40, [8] = 49, [9] = 25, [10] = 179, [11] = 952, [12] = 951, [13] = 291, [14] = 302, [15] = 487, [16] = 54, [17] = 743, [18] = 1000, [19] = 1001, [20] = 954, [21] = 955, [22] = 953, effect = 111}, --[Vocation] = {[1] = Roupa, effect = Efeito da transformação}}

 

 

if getPlayerStorageValue(cid, saga[t[1]].storage) < 1 and getPlayerLevel(cid) < saga[t[1]].level then  return doPlayerSendCancel(cid, "storage :".. saga[t[1]].storage .." = " .. getPlayerStorageValue(cid, saga[t[1]].storage) .."\n level necessário: ".. saga[t[1].level) and false      end 

 

Link para o comentário
Compartilhar em outros sites

  • 0
11 minutos atrás, Nogard disse:
local saga = {[1] = {[1] = 71, level = XXXX, storage = YYYY, [2] = 66, [3] = 91, [4] = 18, [5] = 31, [6] = 92, [7] = 40, [8] = 49, [9] = 25, [10] = 179, [11] = 952, [12] = 951, [13] = 291, [14] = 302, [15] = 487, [16] = 54, [17] = 743, [18] = 1000, [19] = 1001, [20] = 954, [21] = 955, [22] = 953, effect = 111}, --[Vocation] = {[1] = Roupa, effect = Efeito da transformação}}

 

 

if getPlayerStorageValue(cid, saga[t[1]].storage) < 1 and getPlayerLevel(cid) < saga[t[1]].level then  return doPlayerSendCancel(cid, "storage :".. saga[t[1]].storage .." = " .. getPlayerStorageValue(cid, saga[t[1]].storage) .."\n level necessário: ".. saga[t[1].level) and false      end 

 

nosgard e essa parte?

 

Citar
local level = 36 -- Limite para liberar uma saga nova

não vai dar conflito?

Link para o comentário
Compartilhar em outros sites

  • 0

Conflito não vai dar não, a diferença é que agora você pode configurar um level específico pra cada uma. Se o cara ter o level/storage, vai continuar funcionando da mesma forma. 

 

O ideal seria você substituir isso:

 

 

if getPlayerLevel(cid) >= (tonumber(t[1])*level) thendoSetCreatureOutfit(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)elsedoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, voce precisa de level "..(tonumber(t[1]) * level).." usar essa saga.")end

 

 

por isso:

 

 

 

if getPlayerStorageValue(cid, saga[t[1]].storage) > 0 and getPlayerLevel(cid) >= saga[t[1]].level thendoSetCreatureOutfit(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)elsedoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, voce precisa de level ".. saga[t[1]].storage .." usar essa saga.")doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "storage :".. saga[t[1]].storage .." = " .. getPlayerStorageValue(cid, saga[t[1]].storage) .."\n level necessário: ".. saga[t[1].level)return trueend

 

 

 

assim você configura o level certinho.

 

 

Link para o comentário
Compartilhar em outros sites

  • 0
Agora, Nogard disse:

Conflito não vai dar não, a diferença é que agora você pode configurar um level específico pra cada uma. Se o cara ter o level/storage, vai continuar funcionando da mesma forma. 

 

O ideal seria você substituir isso:

 

 

if getPlayerLevel(cid) >= (tonumber(t[1])*level) thendoSetCreatureOutfit(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)elsedoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, voce precisa de level "..(tonumber(t[1]) * level).." usar essa saga.")end

 

 

por isso:

 

 

 

if getPlayerStorageValue(cid, saga[t[1]].storage) > 0 and getPlayerLevel(cid) >= saga[t[1]].level thendoSetCreatureOutfit(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)elsedoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, voce precisa de level ".. saga[t[1]].storage .." usar essa saga.")doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "storage :".. saga[t[1]].storage .." = " .. getPlayerStorageValue(cid, saga[t[1]].storage) .."\n level necessário: ".. saga[t[1].level)return trueend

 

 

 

assim você configura o level certinho.

 

 

tendi mas isso vai funcionar para cada um né no caso ficando assim

 

[1] = {[1] = 71, level = XXXX, storage = YYYY, [2] = 66, [3] = 91, [4] = 18, [5] = 31, [6] = 92, [7] = 40, [8] = 49, [9] = 25, [10] = 179, [11] = 952, [12] = 951, [13] = 291, [14] = 302, [15] = 487, [16] = 54, [17] = 743, [18] = 1000, [19] = 1001, [20] = 954, [21] = 955, [22] = 953, effect = 111

 

[1] = {[1] = 71, level = XXXX, storage = YYYY, [2] = 66, level = xxxx, storage = yyyy, 

 

vai dar para editar cada um? ou o lvl e o storage vai ser para esse completo? ficando o mesmo level e storage para todos dessa linha?

Link para o comentário
Compartilhar em outros sites

  • 0

configura e testa:

 

function onSay(cid, words, param)local saga = {[vocation1] = {[1] = {storage = xxxx, level = xxxx , outfit = {lookType = XXXX}, effect = XX}, [2] = {storage = xxxx, level = xxxx , outfit = {lookType = XXXX}, effect = XX}, [3] = {storage = xxxx, level = xxxx , outfit = {lookType = XXXX}, effect = XX}},[vocation2] = {[1] = {storage = xxxx, level = xxxx , outfit = {lookType = XXXX}, effect = XX}, [2] = {storage = xxxx, level = xxxx , outfit = {lookType = XXXX}, effect = XX}, [3] = {storage = xxxx, level = xxxx , outfit = {lookType = XXXX}, effect = XX}},[vocation3] = {[1] = {storage = xxxx, level = xxxx , outfit = {lookType = XXXX}, effect = XX}, [2] = {storage = xxxx, level = xxxx , outfit = {lookType = XXXX}, effect = XX}, [3] = {storage = xxxx, level = xxxx , outfit = {lookType = XXXX}, effect = XX}}}if not saga[getPlayerVocation(cid)] then  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode trocar de saga.") return trueendlocal t = string.explode(param, ",") if(t[2]) then  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Could not understand.") return trueend if not (tonumber(t[1])) then  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o numero da saga que voce deseja.") return trueend if tonumber(t[1]) > #saga[getPlayerVocation(cid)] or tonumber(t[1]) < 1  thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Essa saga nao existe.")return trueendif getPlayerStorageValue(cid, saga[getPlayerVocation(cid)][t[1]].storage) < 1 and getPlayerLevel(cid) < saga[getPlayerVocation(cid)][t[1]].level then  doPlayerSendCancel(cid, "storage :".. saga[getPlayerVocation(cid)][t[1]].storage .." = " .. getPlayerStorageValue(cid, saga[getPlayerVocation(cid)][t[1]].storage) .."\n level necessário: ".. saga[getPlayerVocation(cid)][t[1]].level)            return true         else     doSetCreatureOutfit(cid, saga[getPlayerVocation(cid)][t[1]].outfit, -1)  doSendMagicEffect(getThingPos(cid), saga[getPlayerVocation(cid)][t[1]].effect) doPlayerSendTextMessage(cid, 25, "Voce escolheu uma nova saga!")doCreatureSay(cid, "Saga!!", TALKTYPE_ORANGE_1) return true  end end    

 

Link para o comentário
Compartilhar em outros sites

  • 0
1 minuto atrás, Nogard disse:

configura e testa:

 

function onSay(cid, words, param)local saga = {[vocation1] = {[1] = {storage = xxxx, level = xxxx , outfit = {lookType = XXXX}, effect = XX}, [2] = {storage = xxxx, level = xxxx , outfit = {lookType = XXXX}, effect = XX}, [3] = {storage = xxxx, level = xxxx , outfit = {lookType = XXXX}, effect = XX}},[vocation2] = {[1] = {storage = xxxx, level = xxxx , outfit = {lookType = XXXX}, effect = XX}, [2] = {storage = xxxx, level = xxxx , outfit = {lookType = XXXX}, effect = XX}, [3] = {storage = xxxx, level = xxxx , outfit = {lookType = XXXX}, effect = XX}},[vocation3] = {[1] = {storage = xxxx, level = xxxx , outfit = {lookType = XXXX}, effect = XX}, [2] = {storage = xxxx, level = xxxx , outfit = {lookType = XXXX}, effect = XX}, [3] = {storage = xxxx, level = xxxx , outfit = {lookType = XXXX}, effect = XX}}}if not saga[getPlayerVocation(cid)] then  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode trocar de saga.") return trueendlocal t = string.explode(param, ",") if(t[2]) then  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Could not understand.") return trueend if not (tonumber(t[1])) then  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o numero da saga que voce deseja.") return trueend if tonumber(t[1]) > #saga[getPlayerVocation(cid)] or tonumber(t[1]) < 1  thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Essa saga nao existe.")return trueendif getPlayerStorageValue(cid, saga[getPlayerVocation(cid)][t[1]].storage) < 1 and getPlayerLevel(cid) < saga[getPlayerVocation(cid)][t[1]].level then  doPlayerSendCancel(cid, "storage :".. saga[getPlayerVocation(cid)][t[1]].storage .." = " .. getPlayerStorageValue(cid, saga[getPlayerVocation(cid)][t[1]].storage) .."\n level necessário: ".. saga[getPlayerVocation(cid)][t[1]].level)            return true         else     doSetCreatureOutfit(cid, saga[getPlayerVocation(cid)][t[1]].outfit, -1)  doSendMagicEffect(getThingPos(cid), saga[getPlayerVocation(cid)][t[1]].effect) doPlayerSendTextMessage(cid, 25, "Voce escolheu uma nova saga!")doCreatureSay(cid, "Saga!!", TALKTYPE_ORANGE_1) return true  end end    

 

Citar

20:11:43] [Error - TalkAction Interface] 

[25/06/2017 20:11:43] data/talkactions/scripts/sagatran.lua:onSay

[25/06/2017 20:11:43] Description: 

[25/06/2017 20:11:43] data/talkactions/scripts/sagatran.lua:34: attempt to index field '?' (a nil value)

[25/06/2017 20:11:43] stack traceback:

[25/06/2017 20:11:43]     data/talkactions/scripts/sagatran.lua:34: in function <data/talkactions/scripts/sagatran.lua:1>

 

 

o meu tfs é 0.3.6

Link para o comentário
Compartilhar em outros sites

  • 0
Agora, Nogard disse:

como você configurou?

nosgard um amigo me fez esse aqui olha

 

no lib isso

 

local saga = {	[1] = {{outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}, {outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}},	[2] = {{outfit = 66, level = 36, storage = 2930, mana = 2000, health = 3000}, {outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}}, 	[3] = {{outfit = 91, level = 36, storage = 2930, mana = 2000, health = 3000}, {outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}}, 	[4] = {{outfit = 18, level = 36, storage = 2930, mana = 2000, health = 3000}, {outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}}, 	[5] = {{outfit = 31, level = 36, storage = 2930, mana = 2000, health = 3000},{outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}}, effect = 111}, }local sagaTransformacao = saga[getPlayerVocation(cid)]

e no talkactions arquivo lua isso

 

local cooldownzin = 3 -- em segundos para esperar a talkaction novamentefunction onSay(cid, words, param, channel)		if(param == '') then --                                                                                   *caso nao digite o numero		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o numero da saga que voce deseja.")		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)		return true	end		local t = string.explode(param, ",")	local transform = sagaTransformacao[tonumber(t[1])]		if not sagaTransformacao then --                                                                                    *caso saga diferente		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao pode trocar de saga.")		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)		return true	end		if getPlayerLevel(cid) < transform.level then --                                                                *caso nao tenha level correspondente a transformacao		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao tem level ".. transform.level .. ".")		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)		return true 	end 		if getPlayerStorageValue(cid, transform.storage) < 0 then             		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce ainda nao completou a saga")		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)		return true	end		if getPlayerStorageValue(cid, 5432) >= os.time() then		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao pode usar ainda, espere ".. getPlayerStorageValue(cid, 5432) - os.time() .." segundos. ")		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)		return true	end 		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.")		return true	end			if tonumber(t[1]) > #sagaTransformacao or tonumber(t[1]) < 1 then		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Essa saga nao existe.")		return true	end		doSetCreatureOutfit(cid, {lookType = transform.outfit}, -1)		doSendMagicEffect(getThingPos(cid), transform.effect)		doPlayerSendTextMessage(cid, 25, "Voce escolheu uma nova saga!")		doPlayerSay(cid, "Saga!!", TALKTYPE_ORANGE_1)		setCreatureMaxMana(cid, getCreatureMana(cid) +)		setCreatureMaxHealth(cid, getCreatureHealth(cid) + transform.health) 		setCreatureMaxMana(cid, getCreatureMana(cid) + transform.mana) 		doPlayerSetStorageValue(cid, 5432, os.time() + cooldownzin)		return trueend

a questão é quando eu abro o servidor da esse erro

 

Spoiler

[25/06/2017 20:17:24] [Error - LuaScriptInterface::loadFile] data/lib/sagatran.lua:7: unexpected symbol near '}'

[25/06/2017 20:17:24] [Warning - LuaScriptInterface::initState] Cannot load data/lib/

[25/06/2017 20:17:24] [Error - LuaScriptInterface::loadFile] data/lib/sagatran.lua:7: unexpected symbol near '}'

[25/06/2017 20:17:24] [Warning - LuaScriptInterface::initState] Cannot load data/lib/

[25/06/2017 20:17:24] [Error - LuaScriptInterface::loadFile] data/lib/sagatran.lua:7: unexpected symbol near '}'

[25/06/2017 20:17:24] [Warning - LuaScriptInterface::initState] Cannot load data/lib/

[25/06/2017 20:17:24] [Error - LuaScriptInterface::loadFile] data/lib/sagatran.lua:7: unexpected symbol near '}'

[25/06/2017 20:17:24] [Warning - LuaScriptInterface::initState] Cannot load data/lib/

[25/06/2017 20:17:24] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/sagatran.lua:59: unexpected symbol near ')'

[25/06/2017 20:17:24] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/sagatran.lua)

[25/06/2017 20:17:24] data/talkactions/scripts/sagatran.lua:59: unexpected symbol near ')'

[25/06/2017 20:17:24] [Error - LuaScriptInterface::loadFile] data/lib/sagatran.lua:7: unexpected symbol near '}'

[25/06/2017 20:17:24] [Warning - LuaScriptInterface::initState] Cannot load data/lib/

[25/06/2017 20:17:25] [Error - LuaScriptInterface::loadFile] data/lib/sagatran.lua:7: unexpected symbol near '}'

[25/06/2017 20:17:25] [Warning - LuaScriptInterface::initState] Cannot load data/lib/

[25/06/2017 20:17:25] [Error - LuaScriptInterface::loadFile] data/lib/sagatran.lua:7: unexpected symbol near '}'

[25/06/2017 20:17:25] [Warning - LuaScriptInterface::initState] Cannot load data/lib/

 

o que está errado no script?

eu tentei tirar e colocar umonte de coisa mas sempre da erro

Link para o comentário
Compartilhar em outros sites

  • 0
local saga = {	[1] = {{outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}, {outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}},	[2] = {{outfit = 66, level = 36, storage = 2930, mana = 2000, health = 3000}, {outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}}, 	[3] = {{outfit = 91, level = 36, storage = 2930, mana = 2000, health = 3000}, {outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}}, 	[4] = {{outfit = 18, level = 36, storage = 2930, mana = 2000, health = 3000}, {outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}}, 	[5] = {{outfit = 31, level = 36, storage = 2930, mana = 2000, health = 3000},{outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}},     effect = 111     }     sagaTransformacao = saga[getPlayerVocation(cid)]

 

 

local cooldownzin = 3 -- em segundos para esperar a talkaction novamentefunction onSay(cid, words, param, channel)		if(param == '') then --                                                                                   *caso nao digite o numero		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o numero da saga que voce deseja.")		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)		return true	end		local t = string.explode(param, ",")	local transform = sagaTransformacao[tonumber(t[1])]		if not sagaTransformacao then --                                                                                    *caso saga diferente		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao pode trocar de saga.")		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)		return true	end		if getPlayerLevel(cid) < transform.level then --                                                                *caso nao tenha level correspondente a transformacao		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao tem level ".. transform.level .. ".")		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)		return true 	end 		if getPlayerStorageValue(cid, transform.storage) < 0 then             		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce ainda nao completou a saga")		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)		return true	end		if getPlayerStorageValue(cid, 5432) >= os.time() then		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao pode usar ainda, espere ".. getPlayerStorageValue(cid, 5432) - os.time() .." segundos. ")		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)		return true	end 		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.")		return true	end			if tonumber(t[1]) > #sagaTransformacao or tonumber(t[1]) < 1 then		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Essa saga nao existe.")		return true	end		doSetCreatureOutfit(cid, {lookType = transform.outfit}, -1)		doSendMagicEffect(getThingPos(cid), transform.effect)		doPlayerSendTextMessage(cid, 25, "Voce escolheu uma nova saga!")		doPlayerSay(cid, "Saga!!", TALKTYPE_ORANGE_1)		setCreatureMaxHealth(cid, getCreatureHealth(cid) + transform.health) 		setCreatureMaxMana(cid, getCreatureMana(cid) + transform.mana) 		doPlayerSetStorageValue(cid, 5432, os.time() + cooldownzin)		return trueend

 

 

@edit os códigos tão bugando no spoiler, wtf

Editado por Nogard
Link para o comentário
Compartilhar em outros sites

  • 0
Agora, Nogard disse:
local saga = {	[1] = {{outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}, {outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}},	[2] = {{outfit = 66, level = 36, storage = 2930, mana = 2000, health = 3000}, {outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}}, 	[3] = {{outfit = 91, level = 36, storage = 2930, mana = 2000, health = 3000}, {outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}}, 	[4] = {{outfit = 18, level = 36, storage = 2930, mana = 2000, health = 3000}, {outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}}, 	[5] = {{outfit = 31, level = 36, storage = 2930, mana = 2000, health = 3000},{outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}},     effect = 111     }

 

 

 

 

local cooldownzin = 3 -- em segundos para esperar a talkaction novamentefunction onSay(cid, words, param, channel)		if(param == '') then --                                                                                   *caso nao digite o numero		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o numero da saga que voce deseja.")		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)		return true	end		local t = string.explode(param, ",")	local transform = sagaTransformacao[tonumber(t[1])]		if not sagaTransformacao then --                                                                                    *caso saga diferente		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao pode trocar de saga.")		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)		return true	end		if getPlayerLevel(cid) < transform.level then --                                                                *caso nao tenha level correspondente a transformacao		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao tem level ".. transform.level .. ".")		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)		return true 	end 		if getPlayerStorageValue(cid, transform.storage) < 0 then             		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce ainda nao completou a saga")		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)		return true	end		if getPlayerStorageValue(cid, 5432) >= os.time() then		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao pode usar ainda, espere ".. getPlayerStorageValue(cid, 5432) - os.time() .." segundos. ")		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)		return true	end 		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.")		return true	end			if tonumber(t[1]) > #sagaTransformacao or tonumber(t[1]) < 1 then		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Essa saga nao existe.")		return true	end		doSetCreatureOutfit(cid, {lookType = transform.outfit}, -1)		doSendMagicEffect(getThingPos(cid), transform.effect)		doPlayerSendTextMessage(cid, 25, "Voce escolheu uma nova saga!")		doPlayerSay(cid, "Saga!!", TALKTYPE_ORANGE_1)		setCreatureMaxHealth(cid, getCreatureHealth(cid) + transform.health) 		setCreatureMaxMana(cid, getCreatureMana(cid) + transform.mana) 		doPlayerSetStorageValue(cid, 5432, os.time() + cooldownzin)		return trueend

 

 

 

 

 

opa foi tudo certinho só que quando tento usar a talkaction no jogo aparece esse erro na distro

 

[25/06/2017 20:29:18] [Error - TalkAction Interface] 

[25/06/2017 20:29:18] data/talkactions/scripts/sagatran.lua:onSay

[25/06/2017 20:29:18] Description: 

[25/06/2017 20:29:18] data/talkactions/scripts/sagatran.lua:13: attempt to index global 'sagaTransformacao' (a nil value)

[25/06/2017 20:29:18] stack traceback:

[25/06/2017 20:29:18]     data/talkactions/scripts/sagatran.lua:13: in function <data/talkactions/scripts/sagatran.lua:4>

 

Link para o comentário
Compartilhar em outros sites

  • 0

my bad, editei ali

 

 

local saga = {	[1] = {{outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}, {outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}},	[2] = {{outfit = 66, level = 36, storage = 2930, mana = 2000, health = 3000}, {outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}}, 	[3] = {{outfit = 91, level = 36, storage = 2930, mana = 2000, health = 3000}, {outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}}, 	[4] = {{outfit = 18, level = 36, storage = 2930, mana = 2000, health = 3000}, {outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}}, 	[5] = {{outfit = 31, level = 36, storage = 2930, mana = 2000, health = 3000},{outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}},     effect = 111     }     sagaTransformacao = saga[getPlayerVocation(cid)]

 

Editado por Nogard
Link para o comentário
Compartilhar em outros sites

  • 0

agora de tudo esses erro

 

Citar

[25/06/2017 20:37:24] [Error - Weapon Interface] 
[25/06/2017 20:37:24] data/lib/sagatran.lua
[25/06/2017 20:37:24] Description: 
[25/06/2017 20:37:24] (internalGetPlayerInfo) Player not found when requesting player info #6

[25/06/2017 20:37:24] [Error - Spell Interface] 
[25/06/2017 20:37:24] data/lib/sagatran.lua
[25/06/2017 20:37:24] Description: 
[25/06/2017 20:37:24] (internalGetPlayerInfo) Player not found when requesting player info #6

[25/06/2017 20:37:24] [Error - Action Interface] 
[25/06/2017 20:37:24] data/lib/sagatran.lua
[25/06/2017 20:37:24] Description: 
[25/06/2017 20:37:25] (internalGetPlayerInfo) Player not found when requesting player info #6

[25/06/2017 20:37:25] [Error - TalkAction Interface] 
[25/06/2017 20:37:25] data/lib/sagatran.lua
[25/06/2017 20:37:25] Description: 
[25/06/2017 20:37:25] (internalGetPlayerInfo) Player not found when requesting player info #6

[25/06/2017 20:37:25] [Error - MoveEvents Interface] 
[25/06/2017 20:37:25] data/lib/sagatran.lua
[25/06/2017 20:37:25] Description: 
[25/06/2017 20:37:25] (internalGetPlayerInfo) Player not found when requesting player info #6

[25/06/2017 20:37:25] [Error - CreatureScript Interface] 
[25/06/2017 20:37:25] data/lib/sagatran.lua
[25/06/2017 20:37:25] Description: 
[25/06/2017 20:37:25] (internalGetPlayerInfo) Player not found when requesting player info #6

[25/06/2017 20:37:25] [Error - GlobalEvent Interface] 
[25/06/2017 20:37:25] data/lib/sagatran.lua
[25/06/2017 20:37:25] Description: 
[25/06/2017 20:37:25] (internalGetPlayerInfo) Player not found when requesting player info #6

[25/06/2017 20:37:31] [Error - Npc interface] 
[25/06/2017 20:37:31] data/lib/sagatran.lua
[25/06/2017 20:37:31] Description: 
[25/06/2017 20:37:31] (internalGetPlayerInfo) Player not found when requesting player info #6

 

Link para o comentário
Compartilhar em outros sites

  • 0

deixa tudo em um arquivo só:

 

local cooldownzin = 3 -- em segundos para esperar a talkaction novamentelocal saga = {	[1] = {{outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}, {outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}},	[2] = {{outfit = 66, level = 36, storage = 2930, mana = 2000, health = 3000}, {outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}}, 	[3] = {{outfit = 91, level = 36, storage = 2930, mana = 2000, health = 3000}, {outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}}, 	[4] = {{outfit = 18, level = 36, storage = 2930, mana = 2000, health = 3000}, {outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}}, 	[5] = {{outfit = 31, level = 36, storage = 2930, mana = 2000, health = 3000},{outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}},     effect = 111     }     local sagaTransformacao = saga[getPlayerVocation(cid)]function onSay(cid, words, param, channel)		if(param == '') then --                                                                                   *caso nao digite o numero		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o numero da saga que voce deseja.")		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)		return true	end		local t = string.explode(param, ",")	local transform = sagaTransformacao[tonumber(t[1])]		if not sagaTransformacao then --                                                                                    *caso saga diferente		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao pode trocar de saga.")		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)		return true	end		if getPlayerLevel(cid) < transform.level then --                                                                *caso nao tenha level correspondente a transformacao		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao tem level ".. transform.level .. ".")		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)		return true 	end 		if getPlayerStorageValue(cid, transform.storage) < 0 then             		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce ainda nao completou a saga")		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)		return true	end		if getPlayerStorageValue(cid, 5432) >= os.time() then		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao pode usar ainda, espere ".. getPlayerStorageValue(cid, 5432) - os.time() .." segundos. ")		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)		return true	end 		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.")		return true	end			if tonumber(t[1]) > #sagaTransformacao or tonumber(t[1]) < 1 then		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Essa saga nao existe.")		return true	end		doSetCreatureOutfit(cid, {lookType = transform.outfit}, -1)		doSendMagicEffect(getThingPos(cid), transform.effect)		doPlayerSendTextMessage(cid, 25, "Voce escolheu uma nova saga!")		doPlayerSay(cid, "Saga!!", TALKTYPE_ORANGE_1)		setCreatureMaxHealth(cid, getCreatureHealth(cid) + transform.health) 		setCreatureMaxMana(cid, getCreatureMana(cid) + transform.mana) 		doPlayerSetStorageValue(cid, 5432, os.time() + cooldownzin)		return trueend

 

Link para o comentário
Compartilhar em outros sites

  • 0
Agora, Nogard disse:

deixa tudo em um arquivo só:

 

local cooldownzin = 3 -- em segundos para esperar a talkaction novamentelocal saga = {	[1] = {{outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}, {outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}},	[2] = {{outfit = 66, level = 36, storage = 2930, mana = 2000, health = 3000}, {outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}}, 	[3] = {{outfit = 91, level = 36, storage = 2930, mana = 2000, health = 3000}, {outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}}, 	[4] = {{outfit = 18, level = 36, storage = 2930, mana = 2000, health = 3000}, {outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}}, 	[5] = {{outfit = 31, level = 36, storage = 2930, mana = 2000, health = 3000},{outfit = 71, level = 36, storage = 2930, mana = 2000, health = 3000}},     effect = 111     }     local sagaTransformacao = saga[getPlayerVocation(cid)]function onSay(cid, words, param, channel)		if(param == '') then --                                                                                   *caso nao digite o numero		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o numero da saga que voce deseja.")		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)		return true	end		local t = string.explode(param, ",")	local transform = sagaTransformacao[tonumber(t[1])]		if not sagaTransformacao then --                                                                                    *caso saga diferente		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao pode trocar de saga.")		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)		return true	end		if getPlayerLevel(cid) < transform.level then --                                                                *caso nao tenha level correspondente a transformacao		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao tem level ".. transform.level .. ".")		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)		return true 	end 		if getPlayerStorageValue(cid, transform.storage) < 0 then             		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce ainda nao completou a saga")		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)		return true	end		if getPlayerStorageValue(cid, 5432) >= os.time() then		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao pode usar ainda, espere ".. getPlayerStorageValue(cid, 5432) - os.time() .." segundos. ")		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)		return true	end 		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.")		return true	end			if tonumber(t[1]) > #sagaTransformacao or tonumber(t[1]) < 1 then		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Essa saga nao existe.")		return true	end		doSetCreatureOutfit(cid, {lookType = transform.outfit}, -1)		doSendMagicEffect(getThingPos(cid), transform.effect)		doPlayerSendTextMessage(cid, 25, "Voce escolheu uma nova saga!")		doPlayerSay(cid, "Saga!!", TALKTYPE_ORANGE_1)		setCreatureMaxHealth(cid, getCreatureHealth(cid) + transform.health) 		setCreatureMaxMana(cid, getCreatureMana(cid) + transform.mana) 		doPlayerSetStorageValue(cid, 5432, os.time() + cooldownzin)		return trueend

 

esse erro agora

 

 

[25/06/2017 20:48:00] [Error - TalkAction Interface] 

[25/06/2017 20:48:00] data/talkactions/scripts/sagatran.lua

[25/06/2017 20:48:00] Description: 

[25/06/2017 20:48:00] (internalGetPlayerInfo) Player not found when requesting player info #6

Link para o comentário
Compartilhar em outros sites

  • 0
local sagaTransformacao = saga[getPlayerVocation(cid)]

coloca /\

 

 

depois de function onSay()

 

 

 

Editado por Nogard
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...