Lbtg
Intermediate OT User
- Joined
- Nov 22, 2008
- Messages
- 2,297
- Reaction score
- 127
Hello so i got this script but it aint working correcly
I want to set so 1000gold x level price for bless now its some mess, if i dont have enought money it says i dont have enought 54 to buy blessings , but the 54 is level ^^ and aswell money taken for bless isint correcly to..
can someone fix it up please?
Thanks in advance <3
Lua:
-- !blessing by artofwork
local bless = {1, 2, 3, 4, 5}
local cost = 1000
local maxlevel = 8
function onSay(cid, words, param)
local lvl = getPlayerLevel(cid)
local new_cost = (lvl * cost) / 1000
local target = getPlayerGUID(cid)
for i = 1, table.maxn(bless) do
if(getPlayerBlessing(cid, bless[i])) then
doPlayerSendCancel(cid, "You have already have been blessed.")
return TRUE
end
end
if (getPlayerLevel(cid) >= maxlevel) then
if(doPlayerRemoveMoney(cid, new_cost) == TRUE) then
for i = 1, table.maxn(bless) do
doPlayerAddBlessing(cid, bless[i])
doPlayerSendTextMessage(cid,22,"You have been successfully blessed.!")
end
else
doPlayerPopupFYI(cid, "You need "..new_cost.." to buy blessings.")
end
elseif(getPlayerLevel(cid) < maxlevel) then
if(doPlayerRemoveMoney(cid, cost) == TRUE) then
for i = 1, table.maxn(bless) do
doPlayerAddBlessing(cid, bless[i])
end
doPlayerPopupFYI(cid, "You have successfully been blessed.")
else
doPlayerPopupFYI(cid, "You need to have "..cost.."gp to buy blessings.")
end
end
return FALSE
end
I want to set so 1000gold x level price for bless now its some mess, if i dont have enought money it says i dont have enought 54 to buy blessings , but the 54 is level ^^ and aswell money taken for bless isint correcly to..
can someone fix it up please?
Thanks in advance <3