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

How do I change the color of a brick by clicking a button on a Text GUI?

Asked by
MikxyB 5
8 years ago

I know very very little about scripting and I just have no clue how to do this.

0
Text Button Gui** my mistakes MikxyB 5 — 8y

2 answers

Log in to vote
1
Answered by 8 years ago

Well first, you need to create a script that is parented to the TextButton. Then, you need to make your script look for the Part in workspace after it has been clicked so that it can change the Part's colour. For example, let's say that the Part is directly in workspace and is named "Hello" and you want to change its colour to Black, you would need to use this following code:

script.Parent.MouseButton1Click:connect(function()
    workspace:FindFirstChild("Hello").BrickColor = BrickColor.new("Black")
end)

This would cause the colour of Hello to change to Black after the TextButton has been clicked.

Ad
Log in to vote
0
Answered by
Edcorp 10
8 years ago

this ain't a request site yo

0
... MikxyB 5 — 8y

Answer this question