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

How do I make an On-Death teleport?

How do i make an On-Death teleport, I have some free ones, but none of them work. I want to have it so when Player is killed, He/She is teleported to the lobby that I have, here is one that i have.

function PwntX_X()
local tag = Humanoid:findFirstChild("creator")
if tag ~= nil then
if tag.Value ~= nil then
local Player = tag.Value
if Player ~= nil then
Player.Character.Torso.CFrame = CFrame.new(4699, 809, -134)
end
end
end
end
Humanoid.Died:connect(PwntX_X)~~~~~~~~~~~~~~~~~

2 comments

0

Please edit your post. Put all you code in a code block, that is, click the little blue Lua symbol and put your code between the squiggly lines it creates.

0

The squiggly lines must be on their own line, that is, ~~~~~~~ (NEW LINE) --[[code]]-- (NEW LINE) ~~~~~~

1 answer

✓ Accepted answer
game:GetService('Players').PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(character)
		character:WaitForChild("Humanoid").Died:connect(function()
wait(5.1) --5 is the average respawn time.
player.Character.Torso.CFrame = CFrame.new(4699, 809, -134)
		end)
	end)
end)

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