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

Why is each parts transparency different?

Asked by 9 years ago

so when the script runs, the character doesnt slowly fade, it instantly sets transparencies, and only seems to happen once

for i = 1,10,1 do
    print(i)
    wait(.1)
    for i, part in pairs(click.Character:GetChildren()) do
        if part:IsA("BasePart") then
            part.Transparency = i*.1
            print("part")
        elseif part:IsA("Hat") then
            part.Handle.Transparency = i*.1
            print("hat")
        end
    end 
end

1 answer

Log in to vote
1
Answered by 9 years ago

In your second loop that loops through all of the character's children, you redefine 'i', so when you're doing i*.1, you're setting its transparency to which order it's parented to the character -- not the initial counter you set up.

0
Thanks! its always the little things that you keep missing and that you dont know :) bubbaman73 143 — 9y
Ad

Answer this question