I am trying to get all of the buttons inside of a surface gui that is in the workspace but for some reason it’s not finding the buttons, I also tried to specify the specific model earlier and it didn’t start the for loop
print("alive")
local buttons = game.Workspace:GetDescendants()
for i, button in pairs(buttons) do
print("started")
if button:IsA("TextButton") then
print("found button")
if button.Parent == "List" then
print("got list")
button.MouseButton1Click:Connect(function()
print("click")
button.Parent.Parent.Info.PotionName.Text = button.Name
end)
end
end
end
also, the model that has all the surface guis IS inside of the workspace
im doing this on a local script that is inside of the playergui
i tried it in a server script and it still didn’t work