Script parented to the text that is suppose to change from Unclaimed to Claimed once the SurfaceGui button is clicked:
local Claimed = script.Parent;
local Frame = Claimed.Parent;
local ClaimRemote = Frame:WaitForChild("RemoteEvent");
ClaimRemote.OnServerEvent:Wait();
print("fired")
Claimed.Text = "Status: Claimed";
Local Script that is parented to StarterPlayerScripts:
local ThingInWorkspace = game.Workspace.OrderBoard.Part.SurfaceGui
local function ConnectEvent(Gui)
local Claim = Gui:WaitForChild("TextButton")
local Connection = nil;
print("aldiemejoost;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;")
Connection = Claim.Activated:Connect(function()
print("clicked")
Connection:Disconnect();
Gui.RemoteEvent:FireServer();
end);
end
for _, Gui in ipairs(ThingInWorkspace:GetChildren()) do
ConnectEvent(Gui);
end
ThingInWorkspace.ChildAdded:Connect(function(Obj)
if (Obj.Name == "_example") then
ConnectEvent(Obj);
end
end);
(Don't mind some of the print statements we were just trying to test it lmao)
We also have the RemoteEvent parented in the order board.

1 comment
Thats not a local script and that wasn't the problem, the button just doesn't get registerd when u press the button.