Advertisement
Guest User

Untitled

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