Ir para conteúdo

Featured Replies

Postado

Boa tarde pessoal do TIBIA KING!

Recentemente baixei a base Poketibia Cyan, nele tem um sistema de trocar TOKENS por HELD itens, só que eu estou com os tokens na bolsa, mas mesmo assim diz que estou sem eles..

Os ids dos tokens são:

 

Devoted Token: ItemID: [14752].

Mighty Token: ItemID: [14750].

Honored Token: ItemID: [14751].

 

esse é o scrip da troca:

function onSay(cid, words, param, channel)
	if not isCreature(cid) then return true end
devotedCount = getPlayerItemCount(cid, devotedToken)
mightyCount = getPlayerItemCount(cid, mightyToken)
honoredCount = getPlayerItemCount(cid, honoredToken)

	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, DevotedToken, 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, mightyToken, 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, mightyToken, 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, mightyToken, 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, honoredToken, 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, honoredToken, 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, honoredToken, 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

Por favor me ajudem, nao consigo de jeito nenhum.

 

 

ESTE É O CÓDIGO ORIGINAL>>

function onSay(cid, words, param, channel)
	if not isCreature(cid) then return true end
devotedCount = getPlayerItemCount(cid, devotedToken)
mightyCount = getPlayerItemCount(cid, mightyToken)
honoredCount = getPlayerItemCount(cid, honoredToken)

	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, DevotedToken, 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, mightyToken, 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, mightyToken, 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, mightyToken, 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, honoredToken, 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, honoredToken, 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, honoredToken, 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

 

Editado por Shinob (veja o histórico de edições)

Gregorio, HaxYu

Corporation Of Technology

  • Respostas 12
  • Visualizações 1.1k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Troque o script por esse ai:     Esse script original do servidor está cheio de gambiarra junto com o MOD! Ai alterei ele quase todo para funcionar normal, teste ai

  • Tenta Assim ! function onSay(cid, words, param, channel) if not isCreature(cid) then return true devotedCount = getPlayerItemCount(cid, 14752) mightyCount = getPlayerItemCount(cid, 14750) honor

Postado

Tenta Assim !

function onSay(cid, words, param, channel)
	if not isCreature(cid) then return true
	
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)
			if doPlayerRemoveItem(cid,14752,1) == TRUE then
			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

 

Kirito_in_the_snow.gif

 

 

Postado
  • Autor
2 minutos atrás, wesquel disse:

Tenta Assim !


function onSay(cid, words, param, channel)
	if not isCreature(cid) then return true
	
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)
			if doPlayerRemoveItem(cid,14752,1) == TRUE then
			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

Tentei, ai apresentou isso:

[31/01/2017 14:37:10] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/otc held.lua:4: 'end' expected (to close 'if' at line 2) near 'devotedCount'
[31/01/2017 14:37:10] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/otc held.lua)
[31/01/2017 14:37:10] data/talkactions/scripts/otc held.lua:4: 'end' expected (to close 'if' at line 2) near 'devotedCount'

 

Gregorio, HaxYu

Corporation Of Technology

Postado
Agora, Shinob disse:


 

Spoiler


function onSay(cid, words, param, channel)
	if not isCreature(cid) then return true
	
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,1)
			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

 

 

Tenta Esse !

Editado por wesquel (veja o histórico de edições)

Kirito_in_the_snow.gif

 

 

Postado
  • Autor

Mesmo erro :(

/2017 14:42:48] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/otc held.lua:4: 'end' expected (to close 'if' at line 2) near 'devotedCount'
[31/01/2017 14:42:48] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/otc held.lua)
[31/01/2017 14:42:48] data/talkactions/scripts/otc held.lua:4: 'end' expected (to close 'if' at line 2) near 'devotedCount'

 

Gregorio, HaxYu

Corporation Of Technology

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo