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

Why does my teleport TextButton script only work in studio?

Asked by 7 years ago
Edited 7 years ago

In roblox studio, I made a teleport script. Then when I played it, it did not work. Here is my code:

script.Parent.MouseButton1Click:connect(function()
game.Players.LocalPlayer.Character.Torso.CFrame = CFrame.new(Here is the position, I forgot the numbers)
end

2 answers

Log in to vote
0
Answered by 7 years ago

Check that you're using a LocalScript, not just a regular script.

Ad
Log in to vote
-1
Answered by
AmWrath 41
7 years ago

Make sure you're referring to PlayerGui, not StarterGui.

Answer this question