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

Why does my character die when teleported?

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.

6 comments

0

You cant teleport a humanoidrootpart without dying. Your gonna have to get all of the children in the character and move those.

0

is there an easy way to do this? Or do i need to manually get every part of the chararcter?

0

you can teleport humanoidrootparts without dying, no idea where you got that from

1

they're probably being teleported somewhere under the part fall height limit

0

The neck probably snaps, use character:GetPrimaryPartCFrame(Vector3.new(position))

0

Elyzzia is correct it was below fall height limit, thanks if u post the answer ill mark it solved

2 answers

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."

1 comment

1

Disregard, I noticed a comment that "it was below fall height limit".

You cant teleport a humanoidrootpart without dying. Your gonna have to get all of the children in the character and move those.

1 comment

0

Yes, you can.

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