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.
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