generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Change the color of a text box

Previous Thread :: Next Thread 
FadedExistence is not online. FadedExistence
Joined: 28 Jun 2011
Total Posts: 818
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
FadedExistence is not online. FadedExistence
Joined: 28 Jun 2011
Total Posts: 818
08 Jul 2014 09:44 AM
Solved.
Report Abuse
qElite is not online. qElite
Joined: 31 Dec 2007
Total Posts: 410
08 Jul 2014 09:46 AM
*Color3.new
Report Abuse
Dinoyipi is not online. 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 is not online. 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
FadedExistence is not online. FadedExistence
Joined: 28 Jun 2011
Total Posts: 818
08 Jul 2014 09:51 AM
I fixed it myself but the function i'm using is probably incorrect.
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
08 Jul 2014 09:52 AM
show us
Report Abuse
FadedExistence is not online. FadedExistence
Joined: 28 Jun 2011
Total Posts: 818
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 is not online. 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
FadedExistence is not online. FadedExistence
Joined: 28 Jun 2011
Total Posts: 818
08 Jul 2014 09:56 AM
Just didn't define what was being clicked I see.
Report Abuse
FadedExistence is not online. FadedExistence
Joined: 28 Jun 2011
Total Posts: 818
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
FadedExistence is not online. FadedExistence
Joined: 28 Jun 2011
Total Posts: 818
08 Jul 2014 10:03 AM
*text
Report Abuse
smiley599 is not online. 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
FadedExistence is not online. FadedExistence
Joined: 28 Jun 2011
Total Posts: 818
08 Jul 2014 10:10 AM
Oh... (Derp moment there)
Report Abuse
FadedExistence is not online. FadedExistence
Joined: 28 Jun 2011
Total Posts: 818
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image