Code:
money()
{
self endon("disconnect");
//Money player starts with
self.money = 0;
curScore = self.score;
curKills = self.kills;
curAssists = self.assists;
dispMoneyText = self createFontString("hudbig", 0.8);
dispMoneyText setPoint("TOPRIGHT", "TOPRIGHT", -5, 0);
for(;;)
{
if (curScore != self.score) {
killsDiff = self.kills - curKills;
assistsDiff = self.assists - curAssists;
self.money += killsDiff * level.moneyKill + assistsDiff * level.moneyAssist;
curScore = self.score;
curKills = self.kills;
curAssistss = self.assists;
}
dispMoneyText setText("^1Money:^4 $ " + self.money);
wait 0.05;
if (self.money > 5000) {
self.money = 5000;
}
}
}
Then in init() add this
level.moneyKill = 100; //money you get for a kill
level.moneyAssist = 20; //money for an assist
after that if you want something like a weapon add this to init()
level.moneyWeapon = 500;
the weapon will cost 500, to put this in a thread do it like this
Code:
buyWeapon()
{
self endon( "disconnect");
self notifyOnPlayerCommand( "5", "+actionslot 2" );
for(;;)
{
if (self.money >= level.moneyWeapon)
{
self.money -= level.moneyWeapon;
self giveWeapon("usp_mp"); self iPrintLnBold("Bought USP");
}
else
{
self iPrintLnBold("^1NOT ^2ENOUGH ^3MONEY!");
}
}
}