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

How To Make An On player Death Teleport To Other Game?

I am trying the make a survival game and when you die you go back the the main host game

onPlayerhealth (0)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if player then
        game:GetService("TeleportService"):Teleport(461654058, player)
    end
end
 

2 comments

0

It would probably be more reliable to use the CharacterRemoving event.

0

why not Humanoid.Died

1 answer

✓ Accepted answer

Died Event Here

hit.Parent.Humanoid.Died:Connect(function()
	local player = game.Players:GetPlayerFromCharacter(hit.Parent)
	game:GetService("TeleportService"):Teleport(461654058, player)
end)

1 comment

0

the professor is cringe !!

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