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

Teleporting player not working in button gui?

Asked by
danglt 185
6 years ago

when i run this my body will be teleported but my head will stay same position and my body will become invisible.

function click()
    game.Players.LocalPlayer.Character.HumanoidRootPart.Position = (Vector3.new(205.45, 11.01, 54.83))
end
script.Parent.MouseButton1Click:Connect(click)
0
Teleport with CFrame and not Vector3, so change Position to CFrame and Vector3 to CFrame User#24403 69 — 6y
0
incap make that a answer or imma jack ur rep DinozCreates 1070 — 6y
0
Thank you! danglt 185 — 6y
0
accept a answer or [solved] plz DinozCreates 1070 — 6y
View all comments (2 more)
0
the answer isn't very good User#24403 69 — 6y
0
thats why i said or [solved], just so its clear its been answered. noob. DinozCreates 1070 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago

Use CFrame of the HumanoidRootPart.

function click()
local c = game.Workspace[game.Players.LocalPlayer.Name]
c.HumanoidRootPart.CFrame = Vector3.new(205.45, 11.01, 54.83)
end
script.Parent.MouseButton1Click:Connect(click)
0
That's not the correct way to get the player char User#24403 69 — 6y
0
get character with game.Players.LocalPlayer.Character. yHasteeD 1819 — 5y
Ad

Answer this question