Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. AddHealth(amount, status)
  2. {
  3. if (self.health < level.maxhealth)
  4. {
  5. if (self.money >= level.itemPrice[status]["General"]["Health"])
  6. {
  7. self.addingHealth = true;
  8. wait 0.01;
  9. if(self.status = "Human")
  10. {
  11. if((self.health + amount) <= level.maxhealth)
  12. {
  13.  
  14. self.health += amount;
  15. self.maxhealth = self.health;
  16. self.money -= level.itemPrice[status]["General"]["Health"];
  17. }
  18. else
  19. {
  20. self.money -= (level.maxhealth - self.health) * (level.itemPrice[status]["General"]["Health"]/amount);
  21. self.health = level.maxhealth;
  22. self.maxhealth = self.health;
  23.  
  24. }
  25. }
  26. else
  27. {
  28. self.health += amount;
  29. self.maxhealth = self.health;
  30. self.money -= level.itemPrice[status]["General"]["Health"];
  31. }
  32.  
  33. self.addingHealth = false;
  34. if (!self.healthMonitor)
  35. self thread MonitorHealth();
  36.  
  37. self iPrintln("^1Health ^7Purchased Successfully");
  38. }
  39. else
  40. self SendError("MoreMoney");
  41. }
  42. else
  43. {
  44. self iprintln("^1You already have the max health");
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement