Hmm, just noticed that this thread was bumped..
Ziro, the code is old though ;o I'll see if I get time to update the code though..
Edit: Made this up fast
PHP Code:
public function onCheckExp(obj) {
if (obj.clientr.exp >= obj.clientr.maxexp) {
onLevelUp();
}
}
function onLevelUp() {
// leveling up code here
}
Basically where you add exp to the player, you would trigger the function
onCheckExp(obj),
obj being the object of the player.
For example if you put this script in a wnpc named LevelingSystem, you would do this where you add exp:
PHP Code:
// 'temp.pl' being the player object
LevelingSystem.trigger("CheckExp", temp.pl);
// or
LevelingSystem.onCheckExp(temp.pl);
Could probably improve it later, just don't have the time right now