|
| 08 Jul 2014 09:36 AM |
| How do I change the background color 3 of a text box because apparently this isn't the way: script.Parent.BackgroundColor3 = BackgroundColor3.new(255, 247, 12) |
|
|
| Report Abuse |
|
|
| |
|
qElite
|
  |
| Joined: 31 Dec 2007 |
| Total Posts: 410 |
|
| |
|
Dinoyipi
|
  |
| Joined: 15 Jul 2011 |
| Total Posts: 198 |
|
|
| 08 Jul 2014 09:48 AM |
Two errors: 1. "X = Color3.new", not "X = BackgroundColor3.new". 2. When editing a Color3 within a script, it looks for a value between 0 and 1. This is easy if you have a color at 255 (1) or 0 (0); otherwise, you need to use division to judge what percentage of 1 is the right value. No need to reach for your calculator, the game can do this for you.
Try this:
script.Parent.BackgroundColor3 = Color3.new(1, 247/255, 12/255) |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 08 Jul 2014 09:50 AM |
remember color3 is between 0 and 1
you could do: script.Parent.BackgroundColor3 = BrickColor.new("Really red").Color |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2014 09:51 AM |
| I fixed it myself but the function i'm using is probably incorrect. |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
| |
|
|
| 08 Jul 2014 09:54 AM |
function onClicked() script.Parent.BackgroundColor3 = Color3.new(1, 247/255, 12/255) end
-- yes line 3 I put what the guy gave me on the forum I figured anything was better then mine |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 08 Jul 2014 09:55 AM |
looks fine to me
just need a connection line like
script.Parent.MouseButton1:connect(onClicked) |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2014 09:56 AM |
| Just didn't define what was being clicked I see. |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2014 10:02 AM |
script.Parent.MouseButton1:connect(onClicked) script.Parent.BackgroundColor3 = Color3.new(251, 255, 8)
Won't let me click the test box now. |
|
|
| Report Abuse |
|
|
| |
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 08 Jul 2014 10:03 AM |
nono, you must include the function onClicked and then the connection like
function onClicked() script.Parent.BackgroundColor3 = Color3.new(1, 247/255, 12/255) end
script.Parent.MouseButton1Down:connect(onClicked) |
|
|
| Report Abuse |
|
|
| |
|
|
| 08 Jul 2014 10:11 AM |
| Makes more sense and I couldn't click it cause I didn't end the script derp. |
|
|
| Report Abuse |
|
|