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

How to make a person teleport to somewhere when their humanoid health is 0?

here is the script I tried to use:

if H.Health == 0 then game:GetService("TeleportService"):Teleport(736802287,player) --replace the numbers with your place id end end

but it didn't work

1 answer

✓ Accepted answer

If you put this code in a Local script then it should work. Please note I put mine in the Players StarterCharacterScripts

game.Players.LocalPlayer.Character.Humanoid.HealthChanged:connect(function(Health)
	if Health == 0 then
		game:GetService("TeleportService"):Teleport(736802287,game.Players.LocalPlayer)
	end
end)

Alternatively, another script has been posted on a similar question.

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