Button not working

Recently I made a party system. Once a party is created, you could set the party to private/public.
Suddenly, the button stopped working. If I were to click it, the function would not even run.
I’m not sure what’s going on here. The local script containing this code is inside the button.

This may have to do with the invisible ui objects bug but I’m not sure. https://gyazo.com/0727be1da66c780fec88e83f2fb77100

script.Parent.MouseButton1Click:Connect(function()
	print("Private button clicked")
	
	local calledfunc = ReplicatedStorage.RemoteEvents.PartySystem:InvokeServer("ChangePrivateStatus")
	if calledfunc == false then
		script.Parent.Text = "Public"
	else
		script.Parent.Text = "Private"
	end

	if script.Parent.Text == "Public" then
		script.Parent.BackgroundColor3 = Color3.fromRGB(85, 170, 0)
	else
		script.Parent.BackgroundColor3 = Color3.fromRGB(170, 0, 0)
	end
end)

Have you tried doing:

script.Parent.Parent.YourButtonName.MouseButton1Click:Connect(function()

end)

I don’t think changing the parent of the local script would change anything.
The mousebuttonclick function is not firing despite me intensively clicking the button.

Did you try?

Is the button .Active enabled? (You may have pressed it on accident in the properties tab.)

https://developer.roblox.com/en-us/api-reference/property/GuiObject/Active
As stated here, the GUI Object (TextButton) will not get any input if the Active is disabled.

Yes, it is active. Here is a list of properties from the button.
image
image

Does the print statement still run?

The print statement does not run when I click the button.

Try increasing the Zindex of the button and then test.

I’ve done some debugging.
This bug is caused by the invisible ui objects roblox bug. https://gyazo.com/59f9226fbeb02b0865f8938e595d9f20
As you can see here, I cloned the button in different positions and one works and one does not.

UPDATE
The bug is caused by an invisible frame from a different screen gui.