Simply,
if I get under lvl 50, my experience and level should be reset to 50 on login.
Exp for lvl 50 is "1,847,300" if it helps.
Here is the script im using, lvl.lua:
Along with the creaturescripts.xml:
And last, login.lua:
It feels like it should be working, but apparently there is something wrong, hopefully someone may see the problem, I do have sources if that can help.
Thanks in advance.
if I get under lvl 50, my experience and level should be reset to 50 on login.
Exp for lvl 50 is "1,847,300" if it helps.
Here is the script im using, lvl.lua:
Code:
function onLogin(cid)
if getPlayerLevel(cid) < 50 then
doPlayerAddExperience(cid, (getExperienceForLevel(50) - getPlayerExperience(cid)))
end
return TRUE
end
Along with the creaturescripts.xml:
Code:
<?xml version="1.0"?>
<creaturescripts>
<event type="login" name="lvl" event="script" value="lvl.lua"/>
<event type="login" name="login" event="script" value="login.lua"/>
</creaturescripts>
And last, login.lua:
Code:
function onLogin(cid)
registerCreatureEvent(cid, "lvl")
return 1
end
It feels like it should be working, but apparently there is something wrong, hopefully someone may see the problem, I do have sources if that can help.
Thanks in advance.
Last edited: