Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

For i,v color change? [Again]

I tried:

local play = game.Workspace.Play


for i,v in pairs(play:GetChildren()) do
    if v.BrickColor == ("Neon orange") then
        v.BrickColor = BrickColor.new("Institutional white")
        wait()
    end
end

Im thinking since I have a seat in the model, I'll need to check if its a part and make all the parts white, would I have to put (play:FindFirstChild("Part"))? Doesn't work, nothing in output. Help?

2 answers

✓ Accepted answer
local play = game.Workspace.Play


for i,v in pairs(play:GetChildren()) do
    if v.BrickColor.Name == ("Neon orange") then --v.BrickColor.Name was added
        v.BrickColor = BrickColor.new("Institutional white")
        wait()
    end
end

When you are referring to the actual string or name of the color, you must put ".Name".

PS: I am currently not at my desktop, so I cannot actually test through Roblox studio, but this is one thing I thought I should mention. Apologies if it does not fix the script entirely.

1 comment

0

Thanks so much :D

What you have should work fine, you just have one problem. In line 5, you have parentheses after your if statement. Easy fix, here's the code:

if v.BrickColor == "Neon orange" then --got rid of the parentheses, those are only for BrickColor.new's.

2 comments

0

Sadly it still doesn't work

0

What's up with all these scripts? Does anyone know v.BrickColor == BrickColor.new("Neon orange") anymore?

This discussion is preserved as it was. New answers, comments, and votes are closed.