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

How would i get the character to fade at once?

Asked by 9 years ago

so when the part is clicked, the character fades ONE PART AT A A TIME. i dont want that, i want them to fade at once. whats getting me the most is the hats.

script.Parent.ClickDetector.MouseClick:connect(function(onClicked)
    for i, part in pairs(onClicked.Character:GetChildren()) do
        onClicked.Character.HumanoidRootPart.Transparency = 1
        if part:IsA("BasePart") then
            for transparency = 0,1,.1 do 
                part.Transparency = transparency
                wait()
                onClicked.Character.HumanoidRootPart.Transparency = 1
            end
            elseif part:IsA("Hat") then
                for transparency = 0,1,.1 do
                    part.Handle.Transparency = transparency
                    wait()
                end
            end
        end
        wait(.2)
        onClicked.Character:MoveTo(Vector3.new(workspace.TutStart.CFrame.X,workspace.TutStart.CFrame.Y+3,workspace.TutStart.CFrame.Z))
        wait(.1)
        for i, part in pairs(onClicked.Character:GetChildren()) do
            onClicked.Character.HumanoidRootPart.Transparency = 1
            if part:IsA("BasePart") then
                for transparency2 = 1,0,-.1 do 
                    onClicked.Character.HumanoidRootPart.Transparency = 1
                    part.Transparency = transparency2
                    wait()
                end
                elseif part:IsA("Hat") then
                    for transparency2 = 1,0,-.1 do
                        onClicked.Character.HumanoidRootPart.Transparency = 1
                        part.Handle.Transparency = transparency2
                        wait()
                    end
                end
            end
        end)

Answer this question