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.