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

How do I make a brick react and change other bricks when somebody touches it?

I'm brand new to scripting, and simply don't know how. I've tried a few things, but none of them work. If somebody could tell me how to make it react and then change other bricks, that would be great.

1 comment

0

An example of what you're attempting to do, and any code if you have it. Simply telling us "change other bricks" doesn't tell us what you're attempting to do here. Thanks in advance.

1 answer

✓ Accepted answer

Well, the best thing here is the onTouched function. It is put into a script like so:

function onTouched(hit) ---The function
---your code
end

script.Parent.Touched:connect(onTouched) ---Connect to onTouched function.

Changing BrickColor and Material is fairly easy.

game.Workspace.PARTNAME.BrickColor = BrickColor.new("COLORNAME")
---Color changing


game.Workspace.PARTNAME.Material = "MATERIALNAME"
---Material changing

Hope you learned something from this. Also, hey creeper didn't expect you to be here lol.

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