GuiButtons Not Working

Everything here works and the script runs except for the part at the end that handles the button being clicked

I was wondering if anyone had an idea on what was wrong with the way I tried doing this and if there is a better way without putting the script inside the button itself

The warn I added also does not work nor do I get any feedback from the output tab

function seteverythinginvisible()
	script.Parent.MainFrame.Popups.PlayPopup.Visble = false
	script.Parent.MainFrame.Popups.CustomizePopup.Visible = false
	
end
local buttons = {
	Battlepassbutton = script.Parent.MainFrame.Buttons.ButtonsGroup["BattlePass "].BattlePassButton,
	PlayButton = script.Parent.MainFrame.Buttons.ButtonsGroup.Play.PlayButton,
	CustomizeButton = script.Parent.MainFrame.Buttons.ButtonsGroup.Inventory.CustomizeButton,
}
local Popups = {
	CustomizePopup = script.Parent.MainFrame.Popups.CustomizePopup,
	Playpopup = script.Parent.MainFrame.Popups.PlayPopup
}
script.Parent.Intro.Visible = true
wait(2)
local warfaretext = script.Parent.Intro["Warfare label"]
local parasolimage = script.Parent.Intro.Parasol

repeat
	task.wait(0.1)parasolimage.ImageTransparency = parasolimage.ImageTransparency - 0.02
until parasolimage.ImageTransparency <= 0
	
if parasolimage.ImageTransparency <= 0 then
    wait(3)
	repeat
		task.wait(0.1)parasolimage.ImageTransparency = parasolimage.ImageTransparency + 0.1
	until parasolimage.ImageTransparency == 1 
	if parasolimage.ImageTransparency == 1 then
		parasolimage.Visible = false 
		parasolimage.Active = false
		wait(2)
		repeat
			task.wait(0.1)warfaretext.TextTransparency = warfaretext.TextTransparency - 0.02
		until warfaretext.TextTransparency <= 0
		if warfaretext.TextTransparency <= 0 then
			wait(3)
			script.Parent.MainFrame.Visible = true 
			repeat
				task.wait(0.1)warfaretext.TextTransparency = warfaretext.TextTransparency + 0.02
				task.wait(0.1)script.Parent.Intro.Transparency = script.Parent.Intro.Transparency + 0.02
			until script.Parent.Intro.Transparency == 1
			if script.Parent.Intro.Transparency == 1 and warfaretext.TextTransparency == 1 then
				script.Parent.Intro.Visible = false
				script.Parent.Intro.Active = false
				script.Parent.MainFrame.Popups.PlayPopup.Visible = true
				
			end
		end
	end
end
-- Gui Button scripting starts here
if buttons.CustomizeButton.MouseButton1Click:Connect() then
	seteverythinginvisible()
	Popups.CustomizePopup.Visible = true
else
	warn("Things aren't looking nice")
end
if buttons.PlayButton.MouseButton1Click:Connect() then
	seteverythinginvisible()
	Popups.Playpopup.Visible = true
end

why would you use an if? just connect the event to a function

buttons.CustomizeButton.MouseButton1Click:Connect(function()
    seteverythinginvisible()
    Popups.CustomizePopup.Visible = true
end)

buttons.PlayButton.MouseButton1Click:Connect(function()
    seteverythinginvisible()
    Popups.Playpopup.Visible = true
end)

While I was looking for a solution I did this and it still did not work


buttons.CustomizeButton.MouseButton1Click:Connect(function()

print("I'm kinda working")

end)

buttons.PlayButton.MouseButton1Click:Connect(function()
seteverythinginvisible()
Popups.PlayPopup.Visible = true
end)

for some reason that still doesnt run even when clicked