I want to make it so when one of the bricks inside the table gets touched it prints something. Here's what i got so far:
bricks = {} for i,v in pairs(game.Workspace.Bricks:GetChildren()) do table.insert(bricks,v) end unpack(bricks).Touched:Connect(function() print("touched") end)
Here's an example of what you're looking for
bricks = {} for _,v in pairs(workspace.Bricks:GetChildren()) do table.insert(bricks, v) --[[v.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then --Delete if you don't want to check here print'touched' end end)]] end for _,v in pairs(bricks) do -- Iterates through the "bricks" table v.Touched:Connect(function(touched) -- checks if anything within the table is touched if touched.Parent:FindFirstChild("Humanoid") then -- checks if it has a humanoid print'hit' -- prints hit if it does end end) end