Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/bless.luanSay
C++ exception
data/talkactions/scripts/bless.luanSay
C++ exception
Lua:
function onSay(cid)
local player = Player(cid)
local totalBlessPrice = 100000
for i = 1, 5 do
if player:hasBlessing(i) then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are alredy blessed!")
end
end
if player:removeMoney(totalBlessPrice) then
player:addBlessing(i, 1)
player:say('You have been blessed', TALKTYPE_MONSTER_SAY)
else
if player:withdrawMoney(totalBlessPrice) then
if player:removeMoney(totalBlessPrice) then
player:addBlessing(i, 1)
player:say('You have been blessed', TALKTYPE_MONSTER_SAY)
else
player:sendCancelMessage("You don't have enough money. You need " .. totalBlessPrice .. " to buy bless.", cid)
end
else
player:sendCancelMessage("You don't have enough money. Not even in your bank account! You need " .. totalBlessPrice .. " to buy bless.", cid)
end
end
return false
end