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)~~~~~~~~~~~~~~~~~
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)