• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[Request] When player dies return skills and magic level

Keru

Entrepreneur
Joined
Jul 24, 2008
Messages
1,780
Solutions
2
Reaction score
169
Location
USA
Hello everybody, well im making a pvp enforced server, but i have a little problem, i want that for example if i die and my magic level down from 70 to 69, when i login ill get magic lvl 70 again. I made this script but it doesnt works :S if somebody can help me please

function onLogin(cid)
if (getPlayerVocation(cid) == 1) then
if getPlayerMagLevel(cid) < 8 then
doPlayerAddMagLevel(cid, 70 - getPlayerMagLevel(cid))
end
end
return TRUE
end
 
yes but for example, every time that you die and if u down to magic level 69 when you login you will get magic level 70
 
LUA:
function onLogin(cid)
	if isSorcerer(cid) then
			if getPlayerMagLevel(cid) ~= 70 then
				doPlayerAddMagLevel(cid, -getPlayerMagLevel(cid))
				doPlayerAddMagLevel(cid, 70)
			end
	end
	if isDruid(cid) then
			if getPlayerMagLevel(cid) ~= 70 then
				doPlayerAddMagLevel(cid, -getPlayerMagLevel(cid))
				doPlayerAddMagLevel(cid, 70)
			end
	end
	if isPaladin then
		if getPlayerMagLevel(cid) ~= 25 then
			doPlayerAddMagLevel(cid, -getPlayerMagLevel(cid))
			doPlayerAddMagLevel(cid, 25)
		end
	end
	if isKnight(cid)
		if getPlayerMagLevel(cid) ~= 8 then
			doPlayerAddMagLevel(cid, -getPlayerMagLevel(cid))
			doPlayerAddMagLevel(cid, 8)
		end
	end
return TRUE
end
But isn't better to make skill/magic rate 0(in config.lua) and set player 'lossskills' to 0?
 
Back
Top