Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make every part of a model change transparency?

Asked by 6 years ago

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.

0
have you tried at all to make this possible? wookey12 174 — 6y

2 answers

Log in to vote
0
Answered by 6 years ago
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
0
hope this helps TheGreatSailor 20 — 6y
Ad
Log in to vote
0
Answered by 6 years ago

game.Workspace.Part.Transparency = Any number

Answer this question