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

Make a brick take the color of another brick?

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

2 comments

0

use :GetTouchingParts()

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

1 answer

✓ Accepted answer
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

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