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: How do i fix this?

Previous Thread :: Next Thread 
donovanisawesome is not online. donovanisawesome
Joined: 18 Aug 2010
Total Posts: 548
06 Jan 2014 07:25 PM
It is supposed to change the color of the textbutton when the cursor goes over it, but It isn't :/

--!

button = script.Parent




function onEnter()
button.BackgroundColor3 = button.BackgroundColor3.new(255, 0, 4)

end

script.Parent.MouseEnter:connect(onEnter)



I get this error
20:24:42.020 - new is not a valid member
Report Abuse
Absurdism is not online. Absurdism
Joined: 18 Jul 2013
Total Posts: 2568
06 Jan 2014 07:26 PM
button.BackgroundColor3 = Color3.new(255, 0, 4)
Report Abuse
TutorialScripter is not online. TutorialScripter
Joined: 16 Nov 2013
Total Posts: 20
06 Jan 2014 07:26 PM
function onEnter()
button.BackgroundColor3 = Color3.new(255/255, 0/255, 4/255)

end

script.Parent.MouseEnter:connect(onEnter)
Report Abuse
Absurdism is not online. Absurdism
Joined: 18 Jul 2013
Total Posts: 2568
06 Jan 2014 07:26 PM
Sorry, I meant:

button.BackgroundColor3 = Color3.new(1, 0, 4/255)
Report Abuse
Absurdism is not online. Absurdism
Joined: 18 Jul 2013
Total Posts: 2568
06 Jan 2014 07:27 PM
Ninja'd.
Report Abuse
donovanisawesome is not online. donovanisawesome
Joined: 18 Aug 2010
Total Posts: 548
06 Jan 2014 07:28 PM
k. thx for replying so fast!
Report Abuse
donovanisawesome is not online. donovanisawesome
Joined: 18 Aug 2010
Total Posts: 548
06 Jan 2014 07:32 PM
Okay, but now I need it to turn to white once the cursor goes OFF. Help?
Report Abuse
Absurdism is not online. Absurdism
Joined: 18 Jul 2013
Total Posts: 2568
06 Jan 2014 07:33 PM
Use MouseLeave.
Report Abuse
donovanisawesome is not online. donovanisawesome
Joined: 18 Aug 2010
Total Posts: 548
06 Jan 2014 07:34 PM
k thx. But I am still a noob, what are the color numbers to get back to white?
Report Abuse
Absurdism is not online. Absurdism
Joined: 18 Jul 2013
Total Posts: 2568
06 Jan 2014 07:35 PM
Same as it is in the GUI, except you divide by 255. So, in the properties interface, it says white is [255, 255, 255]. Color3, however, is not a value ranging from 0-255, but is in fact a float from 0-1. You therefore divide every value by 255 to get the desired Color3. It is [255/255, 255/255, 255/255], or [1, 1, 1].
Report Abuse
donovanisawesome is not online. donovanisawesome
Joined: 18 Aug 2010
Total Posts: 548
06 Jan 2014 07:37 PM
ok, I put this script in, but this changes the color to black once the cursor leaves, I need white.


function onLeft()
button.BackgroundColor3 = Color3.new(255, 255)
end

script.Parent.MouseLeave:connect(onLeft)
Report Abuse
donovanisawesome is not online. donovanisawesome
Joined: 18 Aug 2010
Total Posts: 548
06 Jan 2014 07:38 PM
o, well, okay!

Report Abuse
donovanisawesome is not online. donovanisawesome
Joined: 18 Aug 2010
Total Posts: 548
06 Jan 2014 07:38 PM
do you always divide by 255? or does it change?
Report Abuse
donovanisawesome is not online. donovanisawesome
Joined: 18 Aug 2010
Total Posts: 548
06 Jan 2014 07:39 PM
or do you simply divide the number by itself?
Report Abuse
Absurdism is not online. Absurdism
Joined: 18 Jul 2013
Total Posts: 2568
06 Jan 2014 07:42 PM
No. If you divide it by itself, it would simply return 1; it's the same thing as x^0. You want to divide by 255 always.
Report Abuse
donovanisawesome is not online. donovanisawesome
Joined: 18 Aug 2010
Total Posts: 548
06 Jan 2014 07:43 PM
k thx.
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