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

Make a brick take the color of another brick?

Asked by
DBoi941 57
6 years ago

I am trying to take brick (a) and touch it to brick (b) and brick (b) take the color of brick (a) when they touch.

local parts = workspace:FindPartsInRegion3(FillArea)
        for _, part in pairs(parts) do
            if part.Parent.Name == "NotUsedBlock" then
            model:GetChildren("Build") do
            model.Build.BrickColor.new = part.BrickColor
        end
0
use :GetTouchingParts() greatneil80 2647 — 6y
0
I have question; How does region3 works. i get the fact that its a 3d area but what arguments does region3.new() take and what does each argument mean User#23252 26 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
local parts = workspace:FindPartsInRegion3(FillArea)
for _, part in pairs(parts) do
        if part.Parent.Name == "NotUsedBlock" then
              part.Touched:Connect(function(otherPart)
                     otherPart.BrickColor = part.BrickColor
              end)
        end
end
Ad

Answer this question