The scripts are small and kind of self - explanatory. The first one is to open the gui:
local button = script.Parent local stats = button.Parent.Stats button.MouseButton1Click:connect(function() stats:TweenPosition(UDim2.new({0.025, 0},{0.025, 0}), "Out", "Quart", 2) end)
The second one is to hide it:
local button = script.Parent local stats = button.Parent button.MouseButton1Click:connect(function() stats:TweenPosition(UDim2.new({0.025, 0},{1.2, 0}), "Out", "Quart", 2) end) --Showing position: {0.025, 0},{0.025, 0} --Hidden position: {0.025, 0},{1.2, 0}
The buttons and scripts are located differently. The first local script is located in game>StarterGui>MainButtons>StatsButton. The second one is located in game>StarterGui>MainButtons>Stats>Exit. There is no error in the output. When I test the GUI out by opening it, the frame moves up (like I want it to) but it goes to the side slightly. The frame isn't like that when it's set that with the same exact coordinates as default. Then, when I test it farther by clicking the x button, nothing happens. I'm not experienced with scripting guis, so could someone help me?
Your issue is that you put tables inside of the UDim2.new, you can fix it by simply getting rid of the "{" and "}"