Hello Everyone , I have a problem i want to make a script that will make all parts of my model Named "TransparentWindows" be Transparent when i push a button. The button part is not problem but how do i get all the parts of a model in a script ?
Thank you Forward.
(Sorry there isnt a script because i coudlnt manage to make one)
You can get all child inside the model using :GetChildren()
function, this will return a table with all the children in it , you can then put it inside a variable
example :
local childs = workspace.Model:GetChildren()
and then you can loop through them using a for
loop
example :
local childs = workspace.Model:GetChildren() for i, v in pairs(childs) do print(v.Name) end
then you can check if the child is a part using if
example :
local childs = workspace.Model:GetChildren() for i, v in pairs(childs) do if v:IsA("BasePart") then print(v.. "Is a part!") end end