I’m trying to figure out why this script won’t work.
The ScreenGui is Enabled and I don’t get why it’s not being changed to false when the button is clicked on.
local ClickSound = game.SoundService.ClickSound
local Button = script.Parent
local isHovering = false
local AgreementGui = game.StarterGui.NotificationGui
Button.MouseEnter:Connect(function()
isHovering = true
Button:TweenSize(UDim2.new(0.72, 0, 0.17, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
end)
Button.MouseLeave:Connect(function()
isHovering = false
Button:TweenSize(UDim2.new(0.7, 0, 0.15, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
end)
Button.MouseButton1Click:Connect(function()
if AgreementGui.Enabled == true then
AgreementGui.Enabled= false
ClickSound:Play()
end
end)