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

How to make a player unable to take damage?

So Ive been searching the web for about half an hour and I cant seem to find anything. I was wondeing if anyone knew how to enable and disable immortality?

2 answers

Try using the Changed event:

local immortalityEnabled = true

game.Players.PlayerAdded:Connect(function(player)
	local CharHumanoid = player.Character
	if immortalityEnabled then
		CarHumanoid.Changed:Connect(function(property)
			if property == "Health" then
				CharHumanoid.Health = 100
			end
		end	
	end)
end)

I hope this helps!

1 comment

0

If it doesn't work, try using a 'while' loop.

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