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)
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.