Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AddHealth(amount, status)
- {
- if (self.health < level.maxhealth)
- {
- if (self.money >= level.itemPrice[status]["General"]["Health"])
- {
- self.addingHealth = true;
- wait 0.01;
- if(self.status = "Human")
- {
- if((self.health + amount) <= level.maxhealth)
- {
- self.health += amount;
- self.maxhealth = self.health;
- self.money -= level.itemPrice[status]["General"]["Health"];
- }
- else
- {
- self.money -= (level.maxhealth - self.health) * (level.itemPrice[status]["General"]["Health"]/amount);
- self.health = level.maxhealth;
- self.maxhealth = self.health;
- }
- }
- else
- {
- self.health += amount;
- self.maxhealth = self.health;
- self.money -= level.itemPrice[status]["General"]["Health"];
- }
- self.addingHealth = false;
- if (!self.healthMonitor)
- self thread MonitorHealth();
- self iPrintln("^1Health ^7Purchased Successfully");
- }
- else
- self SendError("MoreMoney");
- }
- else
- {
- self iprintln("^1You already have the max health");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement