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

How can I have a player teleport to another game when they die?

I'm making a horror game and there are 2 places, the start place, and the game place. I want it so that when you die in the game place, you are brought back to the start place. I've tried almost everything yet it keeps failing for me, can somebody help me out?

The script that I was using which isn't working is:

local player = game.Players.LocalPlayer

player.Character.Humanoid.Died:connect(function()
game:GetService('TeleportService'):Teleport(2094965912, player)
end)

1 answer

game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(character)
		character:WaitForChild("Humanoid").Died:Connect(function()
			game:GetService('TeleportService'):Teleport(2094965912, player)
			print("Teleporting")
	end)
	end)
	end)

This should fix it, put it in a local script because it doesn't seem to work in a regular script.

2 comments

0

And you didn't bother to explain?

0

@incapaz IKR

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