Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does my character die when teleported?

Asked by 3 years ago

This question has been solved by the original poster.

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.

0
You cant teleport a humanoidrootpart without dying. Your gonna have to get all of the children in the character and move those. proudCdthekitten 22 — 3y
0
is there an easy way to do this? Or do i need to manually get every part of the chararcter? FizzyFlame 42 — 3y
0
you can teleport humanoidrootparts without dying, no idea where you got that from Elyzzia 1294 — 3y
1
they're probably being teleported somewhere under the part fall height limit Elyzzia 1294 — 3y
View all comments (2 more)
0
The neck probably snaps, use character:GetPrimaryPartCFrame(Vector3.new(position)) greatneil80 2647 — 3y
0
Elyzzia is correct it was below fall height limit, thanks if u post the answer ill mark it solved FizzyFlame 42 — 3y

2 answers

Log in to vote
1
Answered by
raid6n 2196 Moderation Voter Community Moderator
3 years ago
Edited 3 years ago

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
Disregard, I noticed a comment that "it was below fall height limit". raid6n 2196 — 3y
Ad
Log in to vote
-2
Answered by 3 years ago

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

0
Yes, you can. raid6n 2196 — 3y

Answer this question