Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
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!
New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.
I tried making it without the formula for level;experience, but the excessive looping made my server crash. It couldn't handle the amount of loops needed to not make the EXP go over the exact amount.
Although, that was before i found the function getExperienceForLevel()
Put this in the lib of the action you execute. If it's a scroll, put it in actions/lib/actions
Lua:
function doPlayerAddLevel(cid, var)
for i = 1, var do
doPlayerAddExp(cid, getExperienceForLevel(getPlayerLevel(cid)+ 1) - getPlayerExperience(cid))
end
return TRUE
end
Edit:
Example of usage:
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerLevel(cid) >= 2000 then
doPlayerAddLevel(cid, 250)
else
doPlayerAddLevel(cid, 500)
end
return TRUE
end
function doPlayerAddLevel(cid, levels)
if(isPlayer(cid) == TRUE) then
doPlayerAddExperience(cid, getExperienceForLevel(getPlayerLevel(cid)+levels))
else
error("Something went wrong")
end
return TRUE
end
How to use?
Just doPlayerAddLevel(cid, levels) instead of doPlayerAddExperience(cid, exp)