humanoid.Died
is a function for whenever humanoids die. You cannot call it in an if statement. Instead, you're going to want to make a function for when the humanoid dies.
1 | local gameId = 4950975351 |
3 | game.Players.PlayerAdded:Connect( function (plr) |
4 | plr.CharacterAdded:Connect( function (char) |
5 | char:WaitForChild( "Humanoid" ).Died:Connect( function () |
6 | game:GetService( 'TeleportService' ):Teleport(GameId, plr) |
If this fails, then remove the PlayerAdded
and CharacterAdded
functions and insert the rest of the code into a localscript in StarterPlayerScripts. Add local plr = game.Players.LocalPlayer
below local gameId = 4950975351
instead.