I know
game.Workspace.ball.Touched:connect()
Will activate whenever a brick touches the brick ("ball") in the script. But what if there are multiple bricks named ball in workspace, and I want the script to activate whenever any of them are touched? How would I achieve that?
local ball = workspace:GetChildren() for i=1, #ball do if (string.lower(ball[i].Name) == "ball") then ball[i].Touched:connect(function(hit) --Chunk end) end end
Do something like that. The scripts check for a part named "Ball" and if something touches it, the function triggers.