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

How do I make a moving GUI when clicked?

Asked by 8 years ago

Im planning to make an awesome game, just want some help

1 answer

Log in to vote
1
Answered by 8 years ago

If you want it to move to a certain position when clicked you can do

--Must be in a TextButton or ImageButton
script.Parent.MouseButton1Down:connect(function()
    script.Parent:TweenPosition(UDim2.new(.5, 0, .5, 0));
end);

This will move the gui to the position (.5, 0, .5, 0) on screen. The first set (.5, 0) is the X position, in this set we have percent of screen (.5) and pixels (0) the second set is the same but with Y position. You can change these numbers to be whatever you want.

0
Hope this answered you question and helped! MrLonely1221 701 — 8y
Ad

Answer this question