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

How do I make a teleport gui teleport my whole character instead of my lower torso?

Asked by 3 years ago
local player = game.Players.LocalPlayer
local character = player.Character
script.Parent.MouseButton1Click:Connect(function()
    character.LowerTorso.Position = Vector3.new(-51.185, 6.295, 17.411)
end)

it separates my lower torso from my character and it goes flying and i can't move.

3 answers

Log in to vote
1
Answered by
megukoo 877 Moderation Voter
3 years ago

Try teleporting the HumanoidRootPart instead.

0
i did it does the same thing catsalt29 57 — 3y
0
can you try character:MoveTo(Vector3.new(-51.185, 6.295, 17.411))? megukoo 877 — 3y
Ad
Log in to vote
0
Answered by
DrShockz 233 Moderation Voter
3 years ago
Edited 3 years ago

Hello! Hope you're having a great day :D

I see you're struggling to move the player's position, and I'd personally recommend you use CFrame this is a very powerful property as it stores everything about a part, position, rotation, size, etc.

Also to move the player you'd want to teleport it by it's primary part which is usually HumanoidRootPart

So in your script, this is how we would implement it:

First, you will want to put a part where you want the player to teleport. Then in the console at the bottom of your studio input the below command: print(game.Workspace["YOUR PART HERE"].CFrame.Position)

The output will look like so:

100, -50 ,100

Now that we have that we can do this:

local player = game.Players.LocalPlayer
local character = player.Character
local tpCFrame = CFrame.new(100, -50, 100) -- our location

script.Parent.MouseButton1Click:Connect(function()
    character.HumanoidRootPart.CFrame = tpCFrame -- changed the part to the rootpart, and used cframe instead of vector3
end)

I hope I was able to help you today :D

Thanks for reading, - DrShockz

Log in to vote
-2
Answered by
zane21225 243 Moderation Voter
3 years ago

When teleporting, you need to reference the HumanoidRootPart, rather than the LowerTorso.

It's also necessary to do this activity in a Server Script.

script.Parent.Touched:Connect(function(touched)
    if touched.Parent:FindFirstChild('Humanoid') then
        touched.Parent:MoveTo(Vector3.new(-10.5, 6, 16))
    end
end)
0
that makes it walk sabrna563 -7 — 3y
1
no it doesnt. your talking about humanoid:moveto(). its two different methods. get it right smh Alphexus 498 — 3y
0
sabrna no it doesnt zane21225 243 — 3y
0
thanks for the 2 unnecessary downvotes zane21225 243 — 3y
View all comments (2 more)
0
3 :D zadobyte 692 — 3y
1
Don't fasely downvote when this is a valid answer. DrShockz 233 — 3y

Answer this question