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

How to teleport a player when he dies?

We need a script that will teleport the player every time he dies. Can this be done? How?

2 comments

0

Do you want to teleport the player when he respawns or when he is still dead?

0

This is not a request site.

2 answers

✓ Accepted answer

This should work:

local tp = game.Workspace.teleport -- Where your teleport point is.

game.Players.ChildAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		character:WaitForChild("Humanoid").Died:Connect(function()
			
			character:MoveTo(tp.Position)

		end)
	end)
end)
-- you need to get humanoid of died player first
-- teleport is point where's you want your player teleport to
teleport = game.Workspace.teleport
humanoid.Died:Connect(function()
	wait(5) -- wait untill player reset
	humanoid.Parent.HumanoidRootPart.CFrame = teleport.CFrame
end)

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