Gui doesn't go down on function after clicking on button

Helllo,
I was trying to make the blue frame go down, but I only got to manage the corner button. There are no errors in the script.

The issue is that the corner gray gui did go down using offset, but the blue frame isn’t.

Video:

I’ve haven’t thought of any solutions, but I did try using Parent like how i did in the first line of the function. I’ve tried looking all over DevHub, but I found nothing that could help me.

Image:

Screenshot 2021-06-04 092006

Script:

local SettingsCornerTextButton = script.Parent
local CornerButtonFrame = script.Parent.Parent
local TweenService = game:GetService("TweenService")

local button = script.Parent --makes life easier
local frame = script.Parent.Parent -- same thing above
local SettingsGUI = game.StarterGui.SettingsGUI

local Popup = SettingsGUI.Popup
local PopupBackground = SettingsGUI.PopupBackground

button.Activated:Connect(function()
	button.Parent:TweenPosition(UDim2.new(0.899, 0, 0.949, 80), Enum.EasingDirection.Out, Enum.EasingStyle.Quint)
	wait(1)
	SettingsGUI.Popup:TweenPosition(UDim2.new(0.346, 0, 0.212, 100), Enum.EasingDirection.Out, Enum.EasingStyle.Quint)
	wait(2)
	button.Parent:TweenPosition(UDim2.new(0.899, 0, 0.949, 0), Enum.EasingDirection.In, Enum.EasingStyle.Quint)
	Popup:TweenPosition(UDim2.new(0.346, 0, 0.212, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quart)
end)

I’m new to scripting, so I’m sorry if it’s messy.
Thanks for helping me out!

Hold on- not the solution, but a suggestion for future GUI scripts.
You’re changing it from StarterGui, right?
You shouldn’t really do that.
Replace the SettingsGUI var with this:

local SettingsGUI = game.Players.LocalPlayer.PlayerGui.SettingsGUI

wait is that really the solution?

2 Likes

Thank you, this worked for some reason even though you said it wasn’t the solution. :man_shrugging:

Video full of happiness:

2 Likes

Huh, strange. It’s just so that it doesn’t replicate to every player, but I guess since you’re now changing it locally, it should replicate properly.

1 Like