Ir para conteúdo

Posts Recomendados

bom, to com problema nesse script aqui,

 

é igual ao tibia global, cobra bless por level,

 

10k até lvl 30, apartir dai sobe 1k a cada lvl,

 

só que ele ta robando grana dos player, se o player não tem dinheiro suficiente,

 

ele pega um tanto, devolve um tanto e fala que o player não tem o dinheiro que prescisa

 

e não ganha a bless...

 

function onSay(cid, words, param)
local fail = 0

if getPlayerLevel(cid) < 31 then
	cost = 2000
else
	cost = ((getPlayerLevel(cid) - 30) * 200) + 2000
end

if cost > 20000 then
	cost = 20000
end

for i = 1, 5 do
	if getPlayerBlessing(cid, i) then
		fail = fail + 1
	else
		if doPlayerRemoveMoney(cid, cost) == TRUE then
			doPlayerAddBlessing(cid, i)
			if i == 5 and not(fail == 5) then
				doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
			end
		else
			doPlayerSendCancel(cid, "You do not have enough money to buy all the blessings!")
			break
		end
	end
end
if fail == 5 then
	doPlayerSendCancel(cid, "You already have all the blessings!")
end
return TRUE
end

 

espero ajuda, obrigado

Link para o comentário
https://xtibia.com/forum/topic/140230-blessings/
Compartilhar em outros sites

×
×
  • Criar Novo...