Staphy
|
  |
| Joined: 10 Aug 2010 |
| Total Posts: 59 |
|
|
| 10 Nov 2011 12:49 PM |
I have a green GUI I want to turn red once clicked. Here's my script:
function onButtonClicked() script.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0 script.Parent.Text = "You died." script.Parent.BackgroundColor3 = "255; 0; 0" wait(2.9) end
script.Parent.MouseButton1Click:connect(onButtonClicked)
"255; 0; 0" is red, but I don't know the correct syntax for making the change. The rest works fine, including the text change. |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 10 Nov 2011 12:54 PM |
You use this:
Color3.new(255/255, 0, 0).
The colors have to be hexidecimals. |
|
|
| Report Abuse |
|
|
Staphy
|
  |
| Joined: 10 Aug 2010 |
| Total Posts: 59 |
|
| |
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 10 Nov 2011 01:04 PM |
| I hope you didn't blindley copied it, you'll have to replace ""255; 0; 0" " with Color3.new(255/255, 0, 0). |
|
|
| Report Abuse |
|
|
Staphy
|
  |
| Joined: 10 Aug 2010 |
| Total Posts: 59 |
|
|
| 10 Nov 2011 01:09 PM |
So that line becomes:
script.Parent.BackgroundColor3 = "Color3.new(255/255, 0, 0)" ?
If not, sorry, but can you put it in the right spot for me? I'm not great at scripting... |
|
|
| Report Abuse |
|
|
Staphy
|
  |
| Joined: 10 Aug 2010 |
| Total Posts: 59 |
|
|
| 10 Nov 2011 01:10 PM |
| Uh, without the quotes it works. Thank you. |
|
|
| Report Abuse |
|
|