Vá em data/talkactions/scripts cire um arquivo chamado bless.lua e coloque
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_MAGIC_RED)
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
e em data/talkactions/talkactoins.xml
<talkaction words="!bless" event="script" value="bless.lua"/>
Isso ai espero ter ajudado ;D


info
Grupo: Campones
Registrado: 03/10/09
Posts: 4
Reputação: 0
Como eu crio um comando para comprar todas as 5 bless de uma vez?