Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make a script that will make all parts of a model be transparent ?

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)

1 comment

0

I recommend using ":GetDescendants()" to get absolutely all the instances in the model.

1 answer

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

2 comments

0

This is

0

*This answer is very well explained. Helped with my game.

This discussion is preserved as it was. New answers, comments, and votes are closed.