Hi I’m trying to make a script that makes a Model transparent and can Collide loop Something like this while true do local part = game.Workspace.Part part.Transparency = 1 part.CanCollide = false wait(10) part.Transparency = 0 part.CanCollide = true wait(10)
but in that script i need to put it on every part so its messy and if i make it a model it will not work.
You should use a for-loop. Loop through the children of your model and change the properties.
local Model = game.Workspace.Stage1
while true do
for _, parts in pairs(Model:GetChildren()) do
if parts:IsA("BasePart") then
parts.Transparency = 1
parts.CanCollide = false
wait(10)
parts.Transparency = 0
parts.CanCollide = true
wait(10)
end
end
end
local Switch = false
while true do
for i, v in pairs(workspace.Stage1:GetChildren()) do
if v:IsA'BasePart' then
v.CanCollide = Switch
v.Transparency = Switch and 0 or 1
end
end
Switch = not Switch
wait(10)
end