View Single Post
  #7  
Old 08-04-2008, 09:17 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
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
__________________

Last edited by Chompy; 08-04-2008 at 09:29 PM..
Reply With Quote