Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Help on making the player not die.(?)

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

✓ Accepted answer

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.

2 comments

0

I'll accept your answer since its acceptable, but its not what I wanted.

0

What is it you wanted?

Try this

while true do
game.Players.Player1.Humanoid.Health = 100
wait(0.1)
end
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)

This discussion is preserved as it was. New answers, comments, and votes are closed.