tokenzz
:thinking:
- Joined
- Feb 2, 2013
- Messages
- 778
- Solutions
- 2
- Reaction score
- 345
Hiho,
I'm attempting to lower a player's level if they wish to do so, but when they want to lower their level, it will just set their experience that is equivalent to that level, but never set their level to what is equivalent to those experience points. If you relog, your level will be set to the primitive level.
Any clue how I'd lower the player's experience and level without forcing them to relog, as now it will lower the experience that is equivalent to that level but not actually change the player's level.
Thanks in advance!
Kind regards,
t0kenz
I'm attempting to lower a player's level if they wish to do so, but when they want to lower their level, it will just set their experience that is equivalent to that level, but never set their level to what is equivalent to those experience points. If you relog, your level will be set to the primitive level.
Code:
local wishLevel = tonumber(msg)
if string.match(msg,'%d+') then
if (isInArray(levelOptions, wishLevel)) then
npcHandler:say('You have now become level ' .. wishLevel .. '.', cid)
player:addExperience(getExpForLevel(wishLevel) - player:getExperience(), false)
npcHandler.topic[cid] = 0
Any clue how I'd lower the player's experience and level without forcing them to relog, as now it will lower the experience that is equivalent to that level but not actually change the player's level.
Thanks in advance!
Kind regards,
t0kenz