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

Why does this kill me every time I try to Teleport?

So when I teleport for some reason it kills me? Local Script

script.Parent.MouseButton1Click:Connect(function()
	local chemistry = workspace.Teleports.Chemistry
	game.ReplicatedStorage.Event.Teleport:FireServer(chemistry)
end)

Server Script

game.ReplicatedStorage.Event.Teleport.OnServerEvent:Connect(function(player,tp)
		player.Character.Torso.Position = tp.Position
end)

3 comments

0

You have to change the Humanoid Root Part, instead of the Torso, so use this instead: player.Character.HumanoidRootPart.CFrame = CFrame.new(tp.Position)

0

when you remove the torso from the head u die

0

when u remove the torso from the head u die

3 answers

✓ Accepted answer

Just use :SetPrimaryPartCFrame().

game.ReplicatedStorage.Event.Teleport.OnServerEvent:Connect(function(player,tp)
	player.Character:SetPrimaryPartCFrame(tp.CFrame)
end)

2 comments

0

its more simpler to just set the character's HumanoidRootPart CFrame

0

How is it simpler to set the RootPart's CFrame? They both have nearly the same effect. The only difference is what has its CFrame set. My method sets the Head's CFrame.

script.Parent.MouseButton1Click:Connect(function()
    local chemistry = workspace.Teleports.Chemistry
    game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = chemistry.CFrame
end)

4 comments

0

No event needed.

0

thats doesnt work in filteringenabled. if the player can manipulate the game locally then that game will be exploitable which is why we use filteringenabled

0

ANY game can be exploited. FE or not, the character can be moved. Unless you check for it, FE won't stop it. If you are checking it, then use a remote event.

0

If not, what I posted above works, I just tested it in studio.

position ~= cframe i guess

if you set the position of a body part, the weld keeping the part attached to the body gets destroyed

but cframe doesnt do that because cframe is a rebel, and a pacifist

just use cframe instead of position nobody likes position anyway.

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