For each iteration on here, will there be a newly created OnTouch function specific to that argument?
Read code from bottom → top
-- Connections(v) gets called 24x
-- because model has 24 children parts
local function connections(v)
-- OnTouch(hit) declared 24x
-- OnTouch(hit) <- created 24x?
-- because we iterated 24x?
-- or does it only get created once?
local function OnTouch(hit)
...
end
v.Touched:Connect(OnTouch)
end
local Model = workspace.Model:GetChildren()
print(#Model) -> 24 -- 24 children parts
-- Loops 24x because Model has 24 children parts
for _,v in pairs(Model) do
connections(v) -- finally gets ran
... <-- etc codes..
end