Surface Gui Buttons sometimes don't work

Hello everyone,

I’m using a system in the client to connect an event to the Plot’s buttons where you can buy or edit them.
The problem is sometimes the buttons would just refuse to work no errors no printing nothing it just doesn’t press at all. It is somewhat infrequent but I would love to solve it as soon as possible.

Here is the code:

	local RequestPlotInfo = RS.RemoteFunctions:WaitForChild("GetPlotsInfo")
	local PlotInfo = RequestPlotInfo:InvokeServer()

	for _,PlotGui in ipairs(PlotGuiFolder:GetChildren()) do

		PlotGui.BuyButton.Activated:Connect(function()
			print(1)
			Plot = PlotGui.Adornee.Parent	
			local Response,Message = PlotActionRequest:InvokeServer("Buy",Plot,PlotGui)
			if Response == true then
				PopupModule:InfoPop(Player,Message)
			elseif Response == false then
				PopupModule:WarningPop(Player,Message)
			end
		end)

		PlotGui.EditButton.Activated:Connect(function()
			print(2)
			ClearBuildingUI()
			BuildingUI.Visible = false
			Plot = PlotGui.Adornee.Parent	
			local Role = RequestPlayerInfo:InvokeServer("Role")
			local PlotInfo = RequestPlotInfo:InvokeServer()
			local BuildingInPlot = Plot:FindFirstChildWhichIsA("Model")
			if PlotInfo[Plot.Name].Owner == Player.Name then


				
				
				ConstructBuildingUI(Role,PlotInfo[Plot.Name].Size,BuildingInPlot)

			else
				PopupModule:WarningPop(Player,"You do not own this plot")
			end	
		end)

I’m not sure why it happens or why it’s inconsistent.

Maybe there’s a problem with you or in error

there are no errors, it just doesn’t detect button clicks at all

Have you tried to reveal something from settings?

Not sure what you mean but there is no setting that stops button clicks all of a sudden + the bug happens with multiple devices

Look, I’m Arabic and I’m translating.
That’s why you don’t understand

1 Like

Are the Guis you’re detecting their activation event inside the player gui?

No they are a surface gui in the workspace

Maybe look at those posts:

3 Likes

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