It should, ve printed the child’s name but as I said it prints out random numbers which as I guess are how close is the mouse’s click to the corner
And I tried putting .name after but still the same.
here is the code:
local airs = script.Parent.ScrollingFrame:GetChildren()
for I, v in pairs(airs) do
v.MouseButton1Up:Connect(function(selected1)
print(selected1)
end)
end
Small tip: you should make an if statement checking which of the children are TextButtons (if that’s what you are trying to detect), since your code could possibly throw an error if a child is not a TextButton.
Your fixed code:
local airs = script.Parent.ScrollingFrame:GetChildren()
for I, v in pairs(airs) do
if v:IsA("TextButton") then
v.MouseButton1Click:Connect(function()
print(v.Name) -- prints the TextButtons name
end)
end
end
Any errors in the output? Also, what/which instances are you trying to get under the ScrollingFrame? Maybe try MouseButton1Click instead of Activated, as Activated only runs in a LocalScript. I have edited the code in my post above.