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

How To Make Someone Teleport With A GUI?

Asked by
tanzane 100
10 years ago


function BreakRoom() game.Players.LocalPlayer.Character.Humanoid.Torso.Position = Vector3.new(-200.7, 1540.85, -284.04) end script.Parent.MouseButton1Down:connect(BreakRoom)

Unfortunately, this script didn't work. I thought that if I were to teleport their torso somewhere, the rest of their body would come with it. Well, I succeeded in my goal. Though not in the way I had planned. What I'm trying to do is teleport someone when they click a Text Button.

I'm not really sure if any of this info will work but if it does:

"The Place I want to teleport it is in a lobby sort of place. It is a model named BreakRoom . There is a part inside this so called lobby, but not in the model. Its name is ATele . In The Vector3 Value, that is the location of that brick. This is ALL in a local script. Lastly, this Local script is inside StarterGui, ScreenGui, Frame, lastly Text Button. That is all."

I would give you more info but I don't think I can. Thanks For The HELP!

1 answer

Log in to vote
2
Answered by 10 years ago
local player = game.Players.LocalPlayer
repeat wait() until player.Character
local char = player.Character

script.Parent.MouseButton1Down:connect(function()
    char:MoveTo(Vector3.new(-200.7, 1540.85, -284.04))
end)

This should work, basically it waits until the character is found, and when they click the button, it uses the function that all models have called MoveTo which teleports them to a vector, or if it's a part it would be

...
    char:MoveTo(part.Position, part)
...

I believe that is correct anyways

Ad

Answer this question