Author Topic: Leveling up script-help  (Read 1241 times)

Well I wanted this script to make it so that if you chop trees down the more your level goes up for chopping trees down
Here's the Script
Randy helped to..

function serverCmdCheckExp(%client)
{
   messageClient(%client, '', '\c5Exp: %1', %client.exp);
}

function serverCmdCheckLvl(%client)
{
   messageClient(%client, '', '\c5Lvl: %1', %client.getLvl());
}

function GameConnection::getLvl(%this)
{
   return mFloor(%this.exp / 50) + 1;
}

function serverCmdGrantExp(%client, %victim, %amount)
{
   %victim = findClientByBL_ID(%victim);
   if(!isObject(%victim) || %amount <= 0 || %amount > %client.exp)
      return;
   %victim.exp += %amount;
   %client.exp -= %amount; // i'm guessing this is what you want because you're checking if %amount > %client.exp
   messageClient(%client, '', 'Gave %2 %1 exp', %victim.name, %amount);
}

You'll need to edit the tree cutting script to give you exp when you chop a tree down or something.


Off Topic : This guy is TheSub

OK.. why can't I put my real name?
This isn't off topic...

I was also unbanned or else he wouldn't answer my
registration....

Are you wanting to add lvl's for my Tree Cutting code? If so I have made a beta one for Version 2.3 and It will be released as soon as it is done.

I guess I'll let you do it
You already checked for bugs and everything :P

Yeah, I didn't think Randy wanted to help *cough* do *cough* you with your script anymore.