How to fix player teleportation after death

when the specific player dies they tp to a part ? here is my script : script.Parent.Humanoid.Changed:connect(function()
if script.Parent.Humanoid.Health == 0 then
script.Disabled = true
print(“Done”)
local tpClone = game.ServerStorage.TPPart:Clone()
tpClone.Parent = game.Workspace
end
end)

1 Like

script.Parent.HumanoidRootPart.CFrame = tpClone.CFrame * CFrame.new(0, 3, 0)

1 Like

Please consider using the Preformatted Text feature.

Here is how you do it,

Example text

To do that, simply select the text code you have in your post and click the icon that is surrounded by a blue circle on the screenshot below.
image

This can help make your code more visible, and easier to read.
Hope you learned something. :smiley: