I got a tycoon button that on press it gets rid of it puts the model into removedobjects BUT! makes only 1 part invisible and cancollide other parts stay there. i don't need any functions or anything just an example how to make ALL parts invisible in the model
object.Part.Transparency = 1 -- < makes 1 part invisible, when i want all parts in the model to be INVISIBLE! object.Part.CanCollide = false -- same here like in 1st line
Don't make that it destroyes the object because i need it to be invisible, thank you all!
I suggest using In pairs loop, as its loop through all the Children inside the given object
local Model = game.Workspace:FindFirstChild("Model")--Replace Model with your Model name. for _, v in pairs (Model:GetChildren()) do--This Gets all the Children inside your Model and loops through them. if v:IsA("Part") then--Check is the Children inside the Model has a ClassName of Part. v.Transparency = 1--If its ClassName is a Part then Transparency will change to 0 v.CanCollide = false-- Change the Children's CanCollide to false. end end
If you want to know more about Pairs loops