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

Is there a way to change the texture of just the items that are white?

Asked by
Gigaset39 111
1 year ago
Edited 1 year ago

Hello world

Is there a way to change the texture of just the items that are white?

In a folder i have a bounch of Parts, but i want to change the texture of the Parts to SNOW, but just to the ones that are white, not of that ones that are green or smothing else, How i can do that?

1 answer

Log in to vote
1
Answered by 1 year ago
Edited 1 year ago

Well, for example, if your color is 255,255,255 (pure white) you would use this code:

for _, i in pairs(workspace:GetDescendants()) do
    if i:IsA("BasePart") then
        if i.Color == Color3.fromRGB(255,255,255) then
            -- code here
        end
    end
end

Hope this helps!

0
Hello Sir, at line 4 i come whit this: Gigaset39 111 — 1y
0
Part.Material = ("Snow") Gigaset39 111 — 1y
0
is just that.. i cant unterstand how the GetDescendants are called now.. Gigaset39 111 — 1y
0
i finaly found it :D Gigaset39 111 — 1y
0
i.Material = ("Snow") Gigaset39 111 — 1y
Ad

Answer this question