Hello,
Version: 4
As in the title, I have an issue with exp.
I give the player 30 exp for every killed mob and after the second one, I have 60/50 exp instead of 10/162, because 2nd level has been gained.
Does anyone have any idea how should I implement this to work well?
On kill, I give 30 exp like this:
const expToGive = 30;
attacker.exp += expToGive;
console.log('killed mob, exp for next level: ', attacker.expForNextlevel);
Also please check the video: https://imgur.com/MCHvxeK
Edit: In the console also there is this issue:
Edit2: I think something with player.emit & player.on is broken and that's why it does not work
I tested it by:
player.on('Player.test', () => {
console.log('TEST EMIT');
});
setTimeout(() => {
player.emit('Player.test');
}, 2000);
And nothing happens after 2 seconds.
I see that onLevelUp is triggered by _triggerHook, which uses: player.emit('Player.onLevelUp')