Whenever I teleport my character to another part he dies, and it doesn't even show his body. Here's what happens.
This is the script,
local part = script.Parent local place = part:WaitForChild("teleport") local function onPartTouched(otherPart) -- Get the other part's parent local partParent = otherPart.Parent -- Look for a humanoid in the parent local humanoid = partParent:FindFirstChildWhichIsA("Humanoid") if humanoid then humanoid.Parent.HumanoidRootPart.Position = place.Position --print("Cframe = " .. placeCFrame) end end part.Touched:Connect(onPartTouched)
for context, "place" is the brick they are teleported to. Also before you say try CFrame, I've already tried it with CFrame, and it does the exact same thing.
Are you sure it doesn't work if you try CFrame?
Try this:
humanoid.Parent.HumanoidRootPart.CFrame = CFrame.new(place.Position)
Side note: "To correctly teleport a player without killing them, you must use the CFrame property and use the CFrame data type instead."
You cant teleport a humanoidrootpart without dying. Your gonna have to get all of the children in the character and move those.