vexler222
Active Member
- Joined
- Apr 22, 2012
- Messages
- 714
- Solutions
- 15
- Reaction score
- 46
Hi, why this script not work? I can buy bless unlimited times i don't know why ;/
Code:
function addAllBlesses(cid)
local player = Player(cid)
for i = 1, 5 do
if not player:hasBlessing(i) then
player:addBlessing(i, 1)
end
end
end
function onSay(cid)
local player = Player(cid)
local totalBlessPrice = (player:getLevel() * 7 * 7) * 10
local kasa_max = math.floor(totalBlessPrice/10000)
if player:removeMoney(totalBlessPrice) then
addAllBlesses(cid)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Kupiles wszystkie blessy, kosztowalo cie to: " .. kasa_max .." cc")
else
if player:withdrawMoney(totalBlessPrice) then
if player:removeMoney(totalBlessPrice) then
addAllBlesses(cid)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Kupiles wszystkie blessy, kosztowalo cie to: " .. kasa_max .." cc")
else
player:sendCancelMessage("Masz za malo pieniedzy! (Potrzebujesz: " .. kasa_max .. " cc)", cid)
end
else
player:sendCancelMessage("Masz za malo pieniedzy! (Potrzebujesz: " .. kasa_max .. " cc)", cid)
end
end
end