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

Teleport GUI Please Help?

Asked by 10 years ago
script.Parent.MouseButton1Click:connect(function()
    local player = game.Players.LocalPlayer.Character
    player.Torso.CFrame = CFrame.new(-104.5, 194.3, -12.6)

end)[](http://)
0
Is this running in a LocalScript? IcyArticunoX 355 — 10y
0
Yes Timster111 25 — 10y

2 answers

Log in to vote
0
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
10 years ago

Assuming that on line 5, [](http://) was just a typo.. there's nothing wrong with this script. Just make sure it's a localscript inside the desired TextButton or ImageButton.

If something like where you're ending up is wrong then your script isn't wrong, just the coordinates for setting the Torso's CFrame.

Ad
Log in to vote
0
Answered by
nanaluk01 247 Moderation Voter
10 years ago
Places = {Vector3.new(383.4, 254, -630.8), Vector3.new(384.4, 254, -675.6), Vector3.new(328.6, 254, -813.4), Vector3.new(248.4, 254, -788), Vector3.new(257, 254, -655), Vector3.new(380.2, 254, -791.8)} ---Change the figures inside the "{"'s to where you want a player to randomly teleport. You can more, too. You can also just do 1 place, and the player will just teleport to that place
local Player = script.Parent.Parent.Parent.Parent

function Click()
Player.Character:MoveTo(Places[math.random(1,#Places)])
wait()
script.Parent.Parent = game.StarterGui 
script:remove()

script.Parent.MouseButton1Down:connect(Click)

Answer this question