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

Making all parts transparent at the same time?

Asked by
neoG457 315 Moderation Voter
8 years ago
for a,b in pairs(Player.Character.Kagune:GetChildren()) do 
if b:IsA("Part") then

for i = 1, 10 do
b.Transparency = b.Transparency + 0.1

wait(0.1)
end
    end

It works fine however it makes the parts transparent one at a time, how do I make all the parts do this at the same time?

1 answer

Log in to vote
1
Answered by
Unclear 1776 Moderation Voter
8 years ago

Your loops are in the wrong order! You should first iterate through using the counter, and THEN iterate through all of the parts and set the transparency to the value generated by your counter loop.

Here is how you would do this...

for transparency = 0, 1, 0.1 do -- counter loop
    for _, child in next, Player.Character.Kagune:GetChildren() do
        if child:IsA("BasePart") then
            child.Transparency = transparency
        end
    end
    wait(0.1)
end
0
marry me pls neoG457 315 — 8y
0
oh and do you know what this error is: - Content failed because HTTP 400 (HTTP/1.1 400 Value does not fall within the expected range.) neoG457 315 — 8y
Ad

Answer this question