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 every part of a model change transparency?

I want to have it so when the player clicks on the part (a wood floor) , every single part will fade to a transparency of 1 at a random time. For example, you click on a certain part and then the wood floor fades in. Please help.

1 comment

0

have you tried at all to make this possible?

2 answers

modelName = game.Workspace.YOURMODELNAMEHERE:GetChildren()-- make sure that is the path to YOUR model
transparencyValue = .1 --transparency variable

 
while game.Workspace.YOURMODELNAME.PartINYOURMODEL.Transparency <=1 do -- while loop that continues until one of the parts transparency is equal to 1 again make sure you change the path to work with your model
	for _, child in ipairs(modelName) do -- loops through all the parts inside the model
		child.Transparency = transparencyValue --  sets the part equal to the transparencyValue
	end
	transparencyValue = transparencyValue + 0.1 -- Rate at which the transparency increases change this to whatever you want keeping in mind 1 is transparent 0 is solid
	wait(.5) -- waits before starting over again change the time to whatever you want
end

If you need more explanation feel free to message me

Version without comments:

modelName = game.Workspace.LOL:GetChildren()
transparencyValue = .1
while game.Workspace.LOL.Part.Transparency <=1 do
	for _, child in ipairs(modelName) do
		child.Transparency = transparencyValue
	end
	transparencyValue = transparencyValue + 0.1
	wait(.5)
end

1 comment

0

hope this helps

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