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

Why does this only affect one part instead of all of them?

I have a model with 8 parts in it and i want all 8 parts to simultaneously fade away. when i attempt this it seems my method only affects on part instead of all of them

local mchild = model:GetChildren()
for i,v in pairs(mchild) do
	function tran()
		for t = .1,1,.05 do
			RenderStepped:wait()
			v.Transparency = t
			print(v)
		end
	end
end
tran()

1 answer

✓ Accepted answer

To get this to work, you need to swap the loops and move the RenderStepped:wait() to the start of the outer loop, like this:

local mchild = model:GetChildren()
for t = .1,1,.05 do
	RenderStepped:wait()
	for i,v in pairs(mchild) do
		v.Transparency = t
		print(v)
	end
end

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