• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Bless level req

GOD Wille

Excellent OT User
Joined
Jan 11, 2010
Messages
2,826
Solutions
2
Reaction score
815
Location
Sweden
Could any1 fix this blessing script so level req = 10 000 for blessings.

PHP:
 local bless = {1, 2, 3, 4, 5}
local cost = 50000
function onSay(cid, words, param)
    for i = 1, table.maxn(bless) do
        if(getPlayerBlessing(cid, bless[i])) then
            doPlayerSendCancel(cid, "You have already all blessings.")
            return TRUE
        end
    end
 
    if(doPlayerRemoveMoney(cid, cost) == TRUE) then
        for i = 1, table.maxn(bless) do
            doPlayerAddBlessing(cid, bless[i])
        end
        doCreatureSay(cid, "You are now blessed!" ,19)
        doSendMagicEffect(getPlayerPosition(cid), 49)
    else
        doPlayerSendCancel(cid, "You don\'t have enough money.")
    end
    return TRUE
end
 
Code:
local bless = {1, 2, 3, 4, 5} 
local cost = 50000 
function onSay(cid, words, param) 
    for i = 1, table.maxn(bless) do 
        if(getPlayerBlessing(cid, bless[i])) then 
            doPlayerSendCancel(cid, "You have already all blessings.") 
            return TRUE 
        end 
    end 
	
	if getPlayerLevel(cid) < 10000 then
		doPlayerSendCancel(cid, "You are not the required level.")
		return true
	end
	
    if(doPlayerRemoveMoney(cid, cost) == TRUE) then 
        for i = 1, table.maxn(bless) do 
            doPlayerAddBlessing(cid, bless[i]) 
        end 
        doCreatureSay(cid, "You are now blessed!" ,19) 
        doSendMagicEffect(getPlayerPosition(cid), 49) 
    else 
        doPlayerSendCancel(cid, "You don\'t have enough money.") 
    end 
    return TRUE 
end

Start posting in the right section
 
Code:
local bless = {1, 2, 3, 4, 5} 
local cost = 50000 
function onSay(cid, words, param) 
    for i = 1, table.maxn(bless) do 
        if(getPlayerBlessing(cid, bless[i])) then 
            doPlayerSendCancel(cid, "You have already all blessings.") 
		elseif getPlayerLevel(cid) < 10000 then
			doPlayerSendCancel(cid, "You are not the required level.")
		elseif doPlayerRemoveMoney(cid, cost) then 
            doPlayerAddBlessing(cid, bless[i]) 
			doCreatureSay(cid, "You are now blessed!" ,19) 
			doSendMagicEffect(getPlayerPosition(cid), 49) 
    else 
        doPlayerSendCancel(cid, "You don\'t have enough money.") 
		end
	return true
end
end

idc about tabbing
 
Code:
local cost = 2000 -- ##PER BLESS## --
local level = 500

function onSay(cid, words, param, channel)
	for i = 1, 5 do
		if getPlayerBlessing(cid, i) then
			return doPlayerSendCancel(cid, "You already have all of the blessings.")
		end
	end

	if getPlayerLevel(cid) < level then
		if doPlayerRemoveMoney(cid, cost * 5) then
			for i = 1, 5 do
				doPlayerAddBlessing(cid, i)
			end
			
			return doSendMagicEffect(getThingPos(cid), CONST_ME_HOLYAREA) and doCreatureSay(cid, "You have been blessed!", TALKTYPE_ORANGE_1)
		else
			return doPlayerSendCancel(cid, "You do not have enough money.")
		end
	else
		return doPlayerSendCancel(cid, "Sorry, but you cannot purchase blessings at your level.")
	end

	return true
end
 
Last edited:
Buggy, i can only buy blessings one time and if i die and wanna bless again it stays i already got all blessings and still loose all lvls
 
I think you have a creature script that has a problem removing blessings. I've never heard of people buying blessings, dieing, then still having them.
 
LUA:
local bless = {1, 2, 3, 4, 5}
local cost = 50000
function onSay(cid, words, param)
for i = 1, table.maxn(bless) do
if(getPlayerBlessing(cid, bless[i])) then
doPlayerSendCancel(cid, "You have already all blessings.")
return TRUE
end
end
if getPlayerLevel(cid) < 10000 then
		doPlayerSendTextMessage(cid,22,"Sorry, you are under lvl 10000.")
		return 1
	end
	
if(doPlayerRemoveMoney(cid, cost) == TRUE) then
for i = 1, table.maxn(bless) do
doPlayerAddBlessing(cid, bless[i])
end
     doCreatureSay(cid, "You are now blessed!" ,19) 
        doSendMagicEffect(getPlayerPosition(cid), 49)
else
doPlayerSendCancel(cid, "You don\'t have enough money.")

end
return TRUE
end

^^,
 
Back
Top