Greetings everyone! So I made a script where when you press the gui button, a frame tweens. But here´s comes the problem, everytime I click the button, the frame goes on the side of the screen. I tried to change the position but again, the frame went on the side of the screen.
Here´s the script:
local settingsFrame = script.Parent.Parent.SettingsFrame
button.MouseButton1Click:Connect(function()
if settingsFrame.Position == UDim2.new({0.5, 0},{0, -500}) then
settingsFrame:TweenPosition(UDim2.new({0.5, 0},{0, 0}), Enum.EasingDirection.Out, Enum.EasingStyle.Quint, 2)
else
settingsFrame:TweenPosition(UDim2.new({0.5, 0},{0, -500}), Enum.EasingDirection.Out, Enum.EasingStyle.Quint, 2)
end
end)