I want to make it so that when the localplayer dies they are teleported to another game, so I made a localscript and inserted it into ReplicatedFirst and wrote this:
local TeleportService = game:GetService("TeleportService")
local gameID = 2094965912
local player = game.Players.LocalPlayer
player:WaitForChild("Humanoid").Died:connect(function()
TeleportService:Teleport(gameID, player)
end)
However, nothing happened. Can anyone please tell me what I'm doing wrong?

2 comments
Did you try in the game, not studio?
Oh, its supposed to be player.Character