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

How do i color the parts from multiple models?

Asked by 5 years ago

Im trying to color all the parts from multiple models. like there is a model called: "Model" and the other one "Model2" and i want both the parts to color at the same time. If someone could help, thank you!

0
The parts in the model? popeeyy 493 — 5y
0
the parts in multiple models ieatandisbaconhair 77 — 5y

1 answer

Log in to vote
0
Answered by
Voy1980 111
5 years ago

I'm not sure what you're asking in particular, but from what I read you could maybe try something like this?

  1. Ungroup both models
  2. Put everything from both into one model
  3. Insert the script below into the model.
  4. Rename everything you want to change at the same time to what's in the script below, such as "Part"
  5. Add a function based on what you want to do, I already added one as an example which is when a clickdetector gets clicked. Make sure if you use this function to add a clickdetector into your model
  6. Do something with the colors as you intended.
function onClick()
for index, descendant in pairs(descendants) do
    if descendant:IsA("Part") then --Change "Part"
        descendant.BrickColor = BrickColor.Green()
    end
end

script.Parent.ClickDetector.MouseClick:Connect(onClick)
0
Thats not what i meant, and i didnt try the script because i know what it means but i know it works! Thanks for helping anyways? ieatandisbaconhair 77 — 5y
Ad

Answer this question