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
As you know, this is not a request site. I will not make the code for you. But since you have 0 scripting knowledge, here's a few places that can help you learn.
Roblox game development youtube tutorials
Roblox Games Team: Scripting Basics youtube tutorial
Stickmasterluke's scripting youtube tutorials
Also about your original problem, you may want to look into this event.
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
Closed as Not Constructive by Perci1 and BlueTaslem
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?