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

How can i change properties of multiple parts at once in a script?

Hello, I am currently working on making the ground parts in ma game change transparency but instead of doing part1, part2 , part3 I want to select them at once. I tried looking for the answer but it only changes to property of certain parts. I also dont understand the "i" in the loop. please help

local GroundParts = script.Parent.GroundParts -- my folder
local partsFolder = GroundParts:GetChildren() -- getting the parts



while true do
	for i, parts in pairs(partsFolder) do
			parts.Transparency = 1
			
			wait(15) -- 360 seconds -- 6 minutes
		end
	end	

2 answers

✓ Accepted answer

I found your reason, You put the wait after you set it so it waits 15 seconds between changing them!

Here's a new script:

local GroundParts = script.Parent.GroundParts -- my folder
local partsFolder = GroundParts:GetChildren() -- getting the parts

while true do
	
	for i, parts in pairs(partsFolder) do
		parts.Transparency = 1
	end
	
	wait(15)
	
end 

2 comments

0

Thank you!

0

No problem

hey you! have you ever heard of enes? if you are in trouble, better call enes!

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