Basically I have a script where a button is added every 3 seconds to a frame. After that I want to see which button got added, so I run a “Child Added” function to check that, and for some reason it’s not showing and no errors are outputting.
Here is the code:
local btnHolders = script.Parent.buttonHolders
local mainShop = script.Parent.mainShop
local btns = game.ReplicatedStorage:GetChildren()
for i, v in pairs(game.ReplicatedStorage:GetChildren()) do
if v:IsA("TextButton") then
wait(3)
v.Parent = btnHolders
end
end
btnHolders.ChildAdded:Connect(function(child)
print(child.Name)
child.MouseButton1Click:Connect(function()
print("Clicked Button!")
end)
end)