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: BackgroundColor3 glitch

Previous Thread :: Next Thread 
Afr1c4n is not online. Afr1c4n
Joined: 12 Jul 2011
Total Posts: 223
01 Jan 2014 02:42 PM
For some reason I try to turn my gui green but it turns black?? Can anyone fix this?


function OnClicked ()
script.Parent.BackgroundColor3 = Color3.new (1/255/1)
end
script.Parent.MouseButton1Click:connect (OnClicked)
Report Abuse
VilleSlay is not online. VilleSlay
Joined: 14 May 2011
Total Posts: 1405
01 Jan 2014 02:46 PM
Color3 requires 3 different number values. 1/255/1 is only 1. To indicate that they are not the same number, use a comma.

Example:

script.Parent.BackgroundColor3 = Color3.new (1 ,255 ,1)

To actually get the green color you want, you should do this:

function Color(r, g, b)
return Color3.new(r/255, g/255, b/255)
end

script.Parent.BackgroundColor3 = Color(1, 255, 1)--This will call the function named Color.


~~> Ville <~~
Report Abuse
Afr1c4n is not online. Afr1c4n
Joined: 12 Jul 2011
Total Posts: 223
01 Jan 2014 02:49 PM
What if I want it to function when I click so MouseButton1Click
Report Abuse
Kingmouli is not online. Kingmouli
Joined: 28 Sep 2012
Total Posts: 1292
01 Jan 2014 02:49 PM
Output? I think it should be Color3.new(NUMBER BTW 0-1, NUMBER BTW 0-1, NUMBER BTW 0-1)

~Kingmouli, King of the Mouli~
Report Abuse
Kingmouli is not online. Kingmouli
Joined: 28 Sep 2012
Total Posts: 1292
01 Jan 2014 02:51 PM
Someone ninja-ed me xD

~Kingmouli, King of the Mouli~
Report Abuse
VilleSlay is not online. VilleSlay
Joined: 14 May 2011
Total Posts: 1405
01 Jan 2014 02:53 PM
function Color(r, g, b)
return Color3.new(r/255, g/255, b/255)
end


script.Parent.MouseButton1Down:connect(function()
script.Parent.BackgroundColor3 = Color(1, 255, 1)
end)


~~> Ville <~~
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