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

Brick that changes color of other bricks?

I am looking for a script (to put into a certain brick) that changes the color of all bricks that pass through it to a single color of my choice. I'm making a tycoon, so bricks will just be moving down a conveyor belt, passing through the stationary brick that I want to change the color of the other bricks. I have literally 0 scripting knowledge and cannot find any script that does what I have explained above. I've broken 3 of the rules in "How to Post Good Questions and Answers" (Don't ask for someone to do all the work, provide example of code, do not post only explanation), but I seriously can find no example of something that does similar to what I want, and again I can't script so I have to ask for someone to do all the work ._. Pls help and don't delete

2 answers

First of all, if you saw it in the rules, don't ask. Second of all if you want to learn, we are willing to help. However, I will post the code, and an explanation.

color = BrickColor.new('Really red')
script.Parent.Touched:connect(function(part)
if part:IsA('BasePart') then
part.BrickColor = color
end
end)

What this code does is wait for the part to be touched, using the .Touched event, and calls whatever touched it "Part". It checks if what touched it is a BasePart, so a brick, and then changes it's color to the variable Color.

I just wrote this code, so I have no idea if it will work.

-- If I helped leave a +1 Rep <3

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