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

How Do I Teleport A Player To Another Game After Death? [closed]

Asked by 5 years ago

Is Like from camping, If a player dies, he will teleport to another game and that game is a lobby, please help me know the script, I'm not good at scripting, so I need help, please, Advanced Thanks!

Closed as Not Constructive by namespace25, TheluaBanana, and User#24403

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by
Arkrei 389 Moderation Voter
5 years ago
Edited 5 years ago

You can use the Humanoid.Died event and the TeleportService

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:FindFirstChild("Humanoid")

local placeid  = 0 -- enter your gameid here

humanoid.Died:Connect(function()
     game:GetService("TeleportService"):Teleport(placeid, player)
end)
Ad