I need to make it so that a model with 85 parts becomes completely invisible. I wanna see if there's a way to do this with only one line of code so that I don't have to type game.Workspace.MENUCHARS.BLAHBLAH.BLAHBLAH.Transparency = 1 eighty five times. I've tried blahblah = game.Workspace.menuchars.BLAHBLAH:GetChildren() and then blahblah.Transparency = 1, but it of course, didn't work.
You can accomplish this with pairs
Code example:
local menuChars = game.workspace:WaitForChild("MenuChars") -- where ever your model is for index, value in pairs(menuChars:GetChildren()) do -- loop through everything in the model if value:IsA("BasePart") then -- make sure its a part value.Transparency = 1 -- set transparency end end
Use loops, like this:
for _item in pairs(Object:GetChildren()) do item.Transparency = 1 end