Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help on making the player not die.(?)

Asked by
Adryin 120
10 years ago

I did this but I found no error, its a part of the script.

    elseif player.TeamColor  == "Bright red" then
            Character.Humanoid.Health = Character.Humanoid.MaxHealth
            player.Character:MakeJoints()

3 answers

Log in to vote
-1
Answered by
BlackJPI 2658 Snack Break Moderation Voter Community Moderator
10 years ago

If we detect when the property health is changed and immediately change it, the humanoid will never die.

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        repeat wait() until character.Humanoid
        character.Humanoid.Changed:connect(function(property)
            if property == 'Health' then
                print('health changed')
                character.Humanoid.Health = character.Humanoid.MaxHealth
            end
        end)
    end)
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.

0
I'll accept your answer since its acceptable, but its not what I wanted. Adryin 120 — 10y
0
What is it you wanted? BlackJPI 2658 — 10y
Ad
Log in to vote
-1
Answered by 10 years ago

Try this

while true do
game.Players.Player1.Humanoid.Health = 100
wait(0.1)
end
Log in to vote
-1
Answered by 10 years ago
elseif player.TeamColor  == "Bright red" then
Character.Humanoid.Health = Character.Humanoid.MaxHealth
player.Character:MakeJoints()

Correct Code :

elseif player.TeamColor =="Bright red" then
Character.Humanoid.Health = math.huge

Also might want to use a function(player)

Answer this question