darknelson
Member
- Joined
- Jun 19, 2011
- Messages
- 190
- Solutions
- 1
- Reaction score
- 15
im trying to make a bless talkaction, but when u say !bless it works, but when u relog, and say bless again, it take your money again, like is not adding a blessing. or something, please help me
i use nostalrius tfs 1,2 7.7
i use nostalrius tfs 1,2 7.7
Lua:
function onSay(cid, words, param)
local p = Player(cid)
local cost = 30000
if(not(isPlayerPzLocked(cid))) then
if(p:hasBlessing(1) and p:hasBlessing(2) and p:hasBlessing(3) and p:hasBlessing(4) and p:hasBlessing(5) and p:hasBlessing(6) and p:hasBlessing(7) and p:hasBlessing(8)) then
p:sendCancelMessage("You have already been blessed by the gods.")
return false
end
if(Player(cid):removeMoney(cost)) then
for i = 1, 8 do
if not p:hasBlessing(i) then
p:addBlessing(i, 1)
end
end
p:getPosition():sendMagicEffect(50)
p:sendTextMessage(19, "You have been blessed by the gods!")
else
p:sendCancelMessage("You need "..cost.." gold coins to buy all blessings.")
end
else
p:sendCancelMessage("You can't buy bless, when you are in a battle.")
end
return false
end