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

How teleport player to other place inside game when he dies?

When a player dies he will get teleported to an other place inside game

1 comment

0

Use TeleportService() when player health = 0 or died.

2 answers

✓ Accepted answer
-- localscript in startergui
local position = Vector3.new() -- put in 3 number vector to where you want the player to go
game.Players.LocalPlayer.Character:WaitForChild("Humanoid").Died:Connect(function()
	wait(7)
	game.Players.LocalPlayer.Character.HumanoidRootPart.Position = position
end)

try that, im just moving the humanoidrootpart. Also, I am using wait to pause the player from spawning then teleporting. Hopefully your spawn time is 5 seconds, if not then change the wait, vectors are what is used to teleport the player.

local place = 000000 -- Put the id of the other place here
local Teleport = game:GetService('TeleportService')
game.Players.PlayerAdded:connect(function(Player)
Player.CharacterRemoving:connect(function()
Teleport:Teleport(place, Player)
end)
end)

If this fixed your problem, please upvote and accept this answer.

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