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

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

Asked by 5 years ago

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)
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) Simulants 52 — 5y
0
when you remove the torso from the head u die wwwdanielwww 5 — 5y
0
when u remove the torso from the head u die wwwdanielwww 5 — 5y

3 answers

Log in to vote
1
Answered by 5 years ago

Just use :SetPrimaryPartCFrame().

game.ReplicatedStorage.Event.Teleport.OnServerEvent:Connect(function(player,tp)
    player.Character:SetPrimaryPartCFrame(tp.CFrame)
end)
0
its more simpler to just set the character's HumanoidRootPart CFrame User#23365 30 — 5y
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. SummerEquinox 643 — 5y
Ad
Log in to vote
0
Answered by 5 years ago
script.Parent.MouseButton1Click:Connect(function()
    local chemistry = workspace.Teleports.Chemistry
    game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = chemistry.CFrame
end)
0
No event needed. coolboy6786543 113 — 5y
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 wwwdanielwww 5 — 5y
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. coolboy6786543 113 — 5y
0
If not, what I posted above works, I just tested it in studio. coolboy6786543 113 — 5y
Log in to vote
0
Answered by
Fifkee 2017 Community Moderator Moderation Voter
5 years ago

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.

Answer this question