• 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!

level protection

KrychaXX

New Member
Joined
Apr 22, 2008
Messages
91
Reaction score
0
Hi all i have tfs 0.3.6, please, help me modified this script:

PHP:
  function onLogin(cid)
local bless = {1, 2, 3, 4, 5}
local level = 20
        if(getPlayerLevel(cid) <= level) then
                for i = 1, table.maxn(bless) do
                        if(getPlayerBlessing(cid, bless[i])) then
                                return TRUE
                        else
                                doPlayerAddBlessing(cid, bless[i])
                        end
                end
        end
return true
end

add this function to this script:
onPrepareDeath when lvl higher then 76 lvl

Please :)
 
Explain better please... What u want? That players with less lv than 76 no die to pk? if es, go config.lua and find protection lv lol
srry, I'm on itouch so can't write alot
 
Add this to your login.lua.

Code:
	for bless = 1, 5 do
		if getPlayerBlessing(cid, bless) then
			return true
		end
	
		if getPlayerLevel(cid) < 50 then -- Level to receive free blessings.
			doPlayerAddBlessing(cid, bless)
		end
		return true
	end
 
Add this to your login.lua.

Code:
	for bless = 1, 5 do
		if getPlayerBlessing(cid, bless) then
			return true
		end
	
		if getPlayerLevel(cid) < 50 then -- Level to receive free blessings.
			doPlayerAddBlessing(cid, bless)
		end
		return true
	end
why do u return since theres events registration? will stop and wont register unless he adds it at the end =_=
 
Dont work ;/, only work this script: but players after 76 lvl again have all bless (script again give players all bless)

PHP:
function onLogin(cid)
local bless = {1, 2, 3, 4, 5}
local level = 20
        if(getPlayerLevel(cid) <= level) then
                for i = 1, table.maxn(bless) do
                        if(getPlayerBlessing(cid, bless[i])) then
                                return TRUE
                        else
                                doPlayerAddBlessing(cid, bless[i])
                        end
                end
        end
return true
end
 
Back
Top