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

How to change the Transparency of all children in a Folder?

When a player touches a part, I nedd all the parts in front of them, which are in a Folder, to become Visible (Transparency = 0). Now I have a RemoteEvent and a script in each part but maybe I can have just one script in the Folder and that will make all the Parts visible?

1 answer

✓ Accepted answer

Hey there so what we will use to get all the children of your folder is a function called :GetChildren() along with utilising a function called "pairs"

GetChildren returns all of the children in that you took from your parent and turns it into a "table" hence the reason why we are using pairs.

Pairs basically iterates through the table of your choice essentially.


local Folder = game.ServerStorage.Parts:GetChildren()

for i,v in pairs(Folder) do
	if v:IsA("Part") then
	
		v.Transparency = 0
	
	end
end

2 comments

0

fix indentation

0

I fixeed it

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