Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by 4 years ago

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

0
It would probably be more reliable to use the CharacterRemoving event. Wafflecow321 457 — 4y
0
why not Humanoid.Died lunatic5 409 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Died Event Here

hit.Parent.Humanoid.Died:Connect(function()
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    game:GetService("TeleportService"):Teleport(461654058, player)
end)
0
the professor is cringe !! lunatic5 409 — 4y
Ad

Answer this question