Ir para conteúdo

Posts Recomendados

Postado (editado)

Boa tarde Tibia King!

Pessoal, recentemente baixei essa base para meu server:

 

Porém, me deparei com um problema no sistema de troca de HELDS por TOKENS,

 

Eu clico em trocar mas não recebo o HELD, quando não tenho os tokens necessários sou notificado que preciso de X tokens, quando tenho os tokens, ele só dita o comando "15:24 Senhor [400]: #devoted#"

 

mas não me da o held.

No log do servidor aparece isso quando clico em TROCAR:

 

[31/01/2017 15:31:25] [Error - TalkAction Interface] 
[31/01/2017 15:31:25] data/talkactions/scripts/otc held.lua:onSay
[31/01/2017 15:31:25] Description: 
[31/01/2017 15:31:25] data/talkactions/scripts/otc held.lua:33: attempt to index global 'helds' (a nil value)
[31/01/2017 15:31:25] stack traceback:
[31/01/2017 15:31:25]     data/talkactions/scripts/otc held.lua:33: in function <data/talkactions/scripts/otc held.lua:1>

 

 

 

Segue o Script:

 

function onSay(cid, words, param, channel)
	if not isCreature(cid) then return true end
devotedCount = getPlayerItemCount(cid, 14752)
mightyCount = getPlayerItemCount(cid, 14750)
honoredCount = getPlayerItemCount(cid, 14751)

	if words == "#devoted#" then
		if devotedCount >= 20 then
			if math.random(1,2) == 1 then
				tierTable = helds.tiers1
			else
				tierTable = helds.tiers2
			end
			prize = tierTable[math.random(#tierTable)]
			doPlayerAddItem(cid, prize, 1)
			doPlayerRemoveItem(cid, 14752, 20)
			doPlayerSendTextMessage(cid, 19, "You received a "..getItemInfo(prize).name..".")
			doCreatureExecuteTalkAction(cid, "#heldCount#")
		return true
		else
			doPlayerSendTextMessage(cid, 27, "You need 20 Devoted Tokens to pick a held item!")
			doCreatureExecuteTalkAction(cid, "#heldCount#")
		return true
		end
	return true
	end
	
	if words == "#mighty1#" then
		if mightyCount >= 50 then
			if math.random(1,3) == 1 then
				tierTable = helds.tiers1
			elseif math.random(1,3) == 2 then
				tierTable = helds.tiers2
			else
				tierTable = helds.tiers3
			end
			prize = tierTable[math.random(#tierTable)]
			doPlayerAddItem(cid, prize, 1)
			doPlayerRemoveItem(cid, 14750, 50)
			doPlayerSendTextMessage(cid, 19, "You received a "..getItemInfo(prize).name..".")
			doCreatureExecuteTalkAction(cid, "#heldCount#")
		return true
		else
			doPlayerSendTextMessage(cid, 27, "You need 50 Mighty Tokens to pick a held item!")
			doCreatureExecuteTalkAction(cid, "#heldCount#")
		return true
		end
	end
	
	if words == "#mighty2#" then
		if mightyCount >= 100 then
			if math.random(1,3) == 1 then
				tierTable = helds.tiers2
			elseif math.random(1,3) == 2 then
				tierTable = helds.tiers3
			else
				tierTable = helds.tiers4
			end
			prize = tierTable[math.random(#tierTable)]
			doPlayerAddItem(cid, prize, 1)
			doPlayerRemoveItem(cid, 14750, 100)
			doPlayerSendTextMessage(cid, 19, "You received a "..getItemInfo(prize).name..".")
			doCreatureExecuteTalkAction(cid, "#heldCount#")
		return true
		else
			doPlayerSendTextMessage(cid, 27, "You need 100 Mighty Tokens to pick a held item!")
			doCreatureExecuteTalkAction(cid, "#heldCount#")
		return true
		end
	end
	
	if words == "#mighty3#" then
		if mightyCount >= 200 then
			if math.random(1,4) == 1 then
				tierTable = helds.tiers3
			elseif math.random(1,4) == 2 then
				tierTable = helds.tiers4
			elseif math.random(1,4) == 3 then
				tierTable = helds.tiers5
			else
				tierTable = helds.tiers6
			end
			prize = tierTable[math.random(#tierTable)]
			doPlayerAddItem(cid, prize, 1)
			doPlayerRemoveItem(cid, 14750, 200)
			doPlayerSendTextMessage(cid, 19, "You received a "..getItemInfo(prize).name..".")
			doCreatureExecuteTalkAction(cid, "#heldCount#")
		return true
		else
			doPlayerSendTextMessage(cid, 27, "You need 200 Mighty Tokens to pick a held item!")
			doCreatureExecuteTalkAction(cid, "#heldCount#")
		return true
		end
	end
	
	if words == "#honored1#" then
		if honoredCount >= 25 then
			if math.random(1,3) == 1 then
				tierTable = helds.tiers1
			elseif math.random(1,3) == 2 then
				tierTable = helds.tiers2
			else
				tierTable = helds.tiers3
			end
			prize = tierTable[math.random(#tierTable)]
			doPlayerAddItem(cid, prize, 1)
			doPlayerRemoveItem(cid, 14751, 25)
			doPlayerSendTextMessage(cid, 19, "You received a "..getItemInfo(prize).name..".")
			doCreatureExecuteTalkAction(cid, "#heldCount#")
		return true
		else
			doPlayerSendTextMessage(cid, 27, "You need 25 Honored Tokens to pick a held item!")
			doCreatureExecuteTalkAction(cid, "#heldCount#")
		return true
		end
	end
	if words == "#honored2#" then
		if honoredCount >= 50 then
			if math.random(1,3) == 1 then
				tierTable = helds.tiers2
			elseif math.random(1,3) == 2 then
				tierTable = helds.tiers3
			else
				tierTable = helds.tiers4
			end
			prize = tierTable[math.random(#tierTable)]
			doPlayerAddItem(cid, prize, 1)
			doPlayerRemoveItem(cid, 14751, 50)
			doPlayerSendTextMessage(cid, 19, "You received a "..getItemInfo(prize).name..".")
			doCreatureExecuteTalkAction(cid, "#heldCount#")
		return true
		else
			doPlayerSendTextMessage(cid, 27, "You need 50 Honored Tokens to pick a held item!")
			doCreatureExecuteTalkAction(cid, "#heldCount#")
		return true
		end
	end
	
	if words == "#honored3#" then
		if honoredCount >= 100 then
			if math.random(1,4) == 1 then
				tierTable = helds.tiers3
			elseif math.random(1,4) == 2 then
				tierTable = helds.tiers4
			elseif math.random(1,4) == 3 then
				tierTable = helds.tiers5
			else
				tierTable = helds.tiers6
			end
			prize = tierTable[math.random(#tierTable)]
			doPlayerAddItem(cid, prize, 1)
			doPlayerRemoveItem(cid, 14751, 100)
			doPlayerSendTextMessage(cid, 19, "You received a "..getItemInfo(prize).name..".")
			doCreatureExecuteTalkAction(cid, "#heldCount#")
		return true
		else
			doPlayerSendTextMessage(cid, 27, "You need 100 Honored Tokens to pick a held item!")
			doCreatureExecuteTalkAction(cid, "#heldCount#")
		return true
		end
	end
	if words == "#heldCount#" then
		doPlayerSendCancel(cid, "#held#,"..devotedCount..","..mightyCount..","..honoredCount..",")
	return true
	end
return true
end

Me ajudem por favor, já nao sei o que fazer mais..

Editado por Shinob
acrescentar informações (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.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo