Ive been trying to create a script where itll scan the workspace find a folder named in this case
“Track” then look through the models in that folder and scan through every model for parts named “Sensor”.
So far all ive gotten is it to go through the folder and get the parts named sensor in the folder.
where as i want it to go through the folder search through every single model in the folder and look for
parts named “Sensor”.
Find all parts with the name “sensor” in those models.
local track = workspace.Track -- path
-- Loop through all direct descendants (children).
for _,object in ipairs(track:GetChildren()) do
-- Is the child a model?
if object:IsA("Model") then
-- Loop through all descendants of the found model.
for _,descendant in ipairs(object:GetDescendants()) do
-- Skip if the name is not sensor.
if descendant.Name ~= "Sensor" then continue; end
-- optional argument: if descendant:IsA("BasePart") then ... end
descendant.Transparency = 1
end
end
end