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

why wont this change the all the parts brickcolors at once to different colors?

Asked by 5 years ago
Edited 5 years ago
while true do
    wait(1)
    print("working")
    for i,v in pairs(script.Parent:GetChildren()) do
        wait()
        if v:IsA("Part") then
            print("still working")
            if v.BrickColor == BrickColor.new("Really blue") then
                v.BrickColor = BrickColor.new("Really red")
                print("red")
            elseif v.BrickColor == BrickColor.new("Really red") then
                v.BrickColor = BrickColor.new("Lime green")
                print("green")
            elseif v.BrickColor == BrickColor.new("Lime green") then
                v.BrickColor = BrickColor.new("Really blue")
                print("blue")
                if v.BrickColor == BrickColor.new("Really red") then
                    v.BrickColor = BrickColor.new("Lime green")
                    print("green")
                elseif v.BrickColor == BrickColor.new("Lime green") then
                    v.BrickColor = BrickColor.new("Really blue")
                    print("blue")
                elseif v.BrickColor == BrickColor.new("Really blue") then
                    v.BrickColor = BrickColor.new("Really red")
                    print("red")
                if v.BrickColor == BrickColor.new("Lime green") then
                    v.BrickColor = BrickColor.new("Really blue")
                    print("blue")
                elseif v.BrickColor == BrickColor.new("Really blue") then
                    v.BrickColor = BrickColor.new("Really red")
                    print("red")
                elseif v.BrickColor == BrickColor.new("Really red") then
                    v.BrickColor = BrickColor.new("Lime green")
                    print("green")
                end
                end
            end
        end
    end
end

output blue red green meaning they all turn green

0
do they catually change color royaltoe 5144 — 5y
0
I’m on phone so I’ll check more when I get home but it looks like your organization or if statements are super messy. Rather than doing multiple “ifs” you wanna do if and the rest elseif QuikSilver09 5 — 5y
0
i changed it to that but it still didnt work, now made a system that clones one script to all the signed parts and that cloned script changes the part brickcolor, a bit laggy now though Gameplayer365247v2 1055 — 5y

Answer this question