hey guys, do you have an opinion on an easier way to do this script ? where i down need to repeat it every line on a new level reached to change hp? Thanks!
001 | while true do |
002 | wait(. 5 ) |
003 | if player.Points.Level.Value = = 1 then |
004 | player.character.Humanoid.MaxHealth = player.Health.StoredMaxHealth.Value + 1 |
005 | else |
006 | if player.Points.Level.Value = = 2 then |
007 | player.character.Humanoid.MaxHealth = player.Health.StoredMaxHealth.Value + 2 |
008 | else |
009 | if player.Points.Level.Value = = 3 then |
010 | player.character.Humanoid.MaxHealth = player.Health.StoredMaxHealth.Value + 3 |
011 | else |
012 | if player.Points.Level.Value = = 4 then |
013 | player.character.Humanoid.MaxHealth = player.Health.StoredMaxHealth.Value + 4 |
014 | else |
015 | if player.Points.Level.Value = = 5 then |
Hey there,
From what I see so far, you're trying to set the MaxHealth
to the player.Health.StoredMaxHealth.Value + player.Points.Level.Value
.
If you wanted to do this without all that code, it would look like this.
1 | while true do |
2 | wait(. 5 ) |
3 | player.Character.Humanoid.MaxHealth = player.Health.StoredMaxHealth.Value + player.Points.Level.Value |
4 | end |
Just leave a comment if this isn't exactly what you want or you're having any trouble.
If this was helpful remember to accept and upvote the answer.
1 | pointlevel = player.Points.Level.Value |
2 | humanhealth = player.character.Humanoid.MaxHealth |
3 | storedhealth = player.Health.StoredMaxHealth.Value |
4 |
5 | while true do |
6 | wait(. 5 ) |
7 | if pointlevel = = 1 then |
8 | humanhealth = storedhealth + 1 |
9 | else |
etc... continue the script on, changing the numbers. I was in a hurry and there is a way better way to do this.