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

Lua Magic level limit and level limit

Phemus

Member
Joined
Jun 16, 2012
Messages
149
Solutions
2
Reaction score
12
I have this script for a server where there is a limit for magic level. It is supposed that after reaching to that level of magic, the player can't get more experience in magic level. This is the script.

PHP:
local limit = 120
local message = "You have reached the magic level limit."
function onAdvance(cid, skill, oldLevel, newLevel)
if(skill == SKILL__MAGLEVEL) then
if(newLevel >= limit) then
doPlayerSetRate(cid, SKILL__MAGLEVEL, 0)
doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
end
end
return true
end

The problem is that the player still is able to get more percent for the next magic level. Also, I have the same script for a level lock where the player can't get more experience after reaching level 200. It has to work the same way. This is the script for the level limit.
PHP:
local limit = 200
local message = "You have reached the level limit."
function onAdvance(cid, skill, oldLevel, newLevel)
if(skill == SKILL__LEVEL) then
if(newLevel >= limit) then
doPlayerSetRate(cid, SKILL__LEVEL, 0)
doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
end
end
return true
end

I hope you can understand and sorry for my bad english. Btw.. I don't get any error in the console or anything.
 
Last edited:
Back
Top