PHP:
local levelNeeded = 30
local basePrice = 2000
local blessLeveled = true
local bless = {}
local t = 0
function onSay(cid, words, param, channel)
local level = getPlayerLevel(cid)
local v = (blessLeveled and ((level > 30 and level < 120) and ((level - 30) * 200 + basePrice) or level > 120 and 20000 or level < 30 and basePrice) or 10000)
for i = 1, 5 do
if not getPlayerBlessing(cid, i) then
table.insert(bless, i)
t = t + 1
end
end
if level >= levelNeeded then
local price = v
if doPlayerRemoveMoney(cid, price * t) then
for i = 1, 5 do
if not getPlayerBlessing(cid, i) then doPlayerAddBlessing(cid, i) end
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, (price * t > 0 and "You bought " .. t .. " blessings for " .. price * t .. " gold coins." or "You already have all blessings."))
doSendMagicEffect(getCreaturePosition(cid), (price * t > 0 and CONST_ME_MAGIC_RED or CONST_ME_POFF))
price = 0
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You do not have enough money.")
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need level " .. levelNeeded .. " or higher to buy blessings.")
return true
end
end
im lvl 155 i got 210k on my bp and it says i dont have enoguth money, why'