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.
~~~~~~~~~~~~~~~~~local Humanoid = script.Parent.Zombie
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)~~~~~~~~~~~~~~~~~