I have a textbutton in my Billboard GUI, and the code is as follows:
for _, egg in pairs(eggs:GetChildren()) do
local eggData = eggsData[egg.Name];
local billboard = game.ReplicatedStorage["Egg Templates"]["Main Billboard"]:Clone();
billboard.Frame.Frame["Hatch 1"].C.MouseButton1Click:Connect(function()
Pet:FireServer(egg.Name);
end)
end
Put the billboard gui in StarterGui. “Main Billboard” has a property called “Adornee”. Set the adornee to the part you want it to be attached to and you should be good to go.
Billboard guis not in PlayerGui cannot be interacted with
If I remember correctly…
To interact with UI in workspace like SurfaceGui and BillBoardGui you need to keep them in PlayerGui (place them in StarterGui) and then set their Adornee property onto the object in order for the UI to appear.