I did this but I found no error, its a part of the script.
1 | elseif player.TeamColor = = "Bright red" then |
2 | Character.Humanoid.Health = Character.Humanoid.MaxHealth |
3 | player.Character:MakeJoints() |
If we detect when the property health is changed and immediately change it, the humanoid will never die.
01 | game.Players.PlayerAdded:connect( function (player) |
02 | player.CharacterAdded:connect( function (character) |
03 | repeat wait() until character.Humanoid |
04 | character.Humanoid.Changed:connect( function (property) |
05 | if property = = 'Health' then |
06 | print ( 'health changed' ) |
07 | character.Humanoid.Health = character.Humanoid.MaxHealth |
08 | end |
09 | end ) |
10 | end ) |
11 | end ) |
NOTE: The health bar will not update back to what it should be and the damage GUI will still be shown, however the health will always stay at the Humanoid's MaxHealth.
Try this
1 | while true do |
2 | game.Players.Player 1. Humanoid.Health = 100 |
3 | wait( 0.1 ) |
4 | end |
1 | elseif player.TeamColor = = "Bright red" then |
2 | Character.Humanoid.Health = Character.Humanoid.MaxHealth |
3 | player.Character:MakeJoints() |
Correct Code :
1 | elseif player.TeamColor = = "Bright red" then |
2 | Character.Humanoid.Health = math.huge |
Also might want to use a function(player)