Surface GUI buttons are not working

I am creating a menu that can spawn parts when you click textbuttons on a surface GUI.

My surface GUI is in StarterGUI and adornee’d to a part. I have local scripts inside each button to swap between part menus.

Here is my script to switch these menus;

local sp = script.Parent

local gui = game:GetService("Players").LocalPlayer.PlayerGui.SpawningMenu

function interact()
	gui:SetAttribute("showing", sp:GetAttribute("changeto"))
end

sp.Activated:Connect(interact)

There is a different script that handles the menu switching but that should be irrelevant in this topic.

When activating a textbutton, nothing actually happens when this script is a child of it. Even a simple check such as putting say print("test") does not give results. I’ve had a look around on the forum and not found much on my issue. Anyone able to give a hand?

1 Like

For some reason when I rewrote it, it worked. A bit strange but, hey! I’m not complaining!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.