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: Color changing Gui - Unexpected results

Previous Thread :: Next Thread 
cool12309 is not online. cool12309
Joined: 21 Sep 2008
Total Posts: 1442
22 Jul 2011 08:19 PM
local Number1 = 1
local Number2 = 1
local Number3 = 1
local Color = 1
coroutine.resume(coroutine.create(function()
while wait() do
if Color == 1 then
if Number1 >= 255 then
Color = 2
Number2 = 1
else
Number1 = Number1 + 1
end
elseif Color == 2 then
if Number2 >= 255 then
Color = 3
Number3 = 1
else
Number2 = Number2 + 1
end
elseif Color == 3 then
if Number3 >= 255 then
Color = 1
Number1 = 1
else
Number3 = Number3 + 1
end
end
for Index, Value in pairs(ScreenGui:GetChildren()) do
if Value.Name:sub(1, 4) == "Line" then
Value.BorderColor3 = Color3.new(Number1, Number2, Number3)
end
end
end
end))

What that does is it make the gui go from black to blue, black to red, black to green, and repeat. It's supposed to go from black to red, red + green, green + blue, blue + red, and repeat the last 3. Any ideas...?
Report Abuse
cool12309 is not online. cool12309
Joined: 21 Sep 2008
Total Posts: 1442
22 Jul 2011 09:44 PM
Top of the page.
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
22 Jul 2011 09:47 PM
You can take a look at mine to show you what to do. :P
Your script confuses me. :(

http://www.roblox.com/Color-Transition-Script-item?id=55827806


-------------------------------------
http://www.roblox.com/Groups/Group.aspx?gid=372
          ~~~ AFF ~~~
-------------------------------------
Report Abuse
cool12309 is not online. cool12309
Joined: 21 Sep 2008
Total Posts: 1442
22 Jul 2011 09:49 PM
Hehe, that's what I was hoping you would do ;D
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
22 Jul 2011 09:52 PM
^_^
Report Abuse
cool12309 is not online. cool12309
Joined: 21 Sep 2008
Total Posts: 1442
22 Jul 2011 09:59 PM
Actually nvm, that's not what I wanted at all O_o

After modifying it to do it correctly, it makes insane colors. Did you look at the expected results? D:

Basicly, transitioning between R-G, G-B, and B-R
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
22 Jul 2011 10:02 PM
You're going to have to explain that to me. Can you post the script as well? I don't have my ROBLOX Studio open.
Report Abuse
cool12309 is not online. cool12309
Joined: 21 Sep 2008
Total Posts: 1442
22 Jul 2011 10:10 PM
PMed
Report Abuse
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
22 Jul 2011 10:16 PM
a = 255
b = 1
c = 1
for i = 1, 255 do
a = a - 1
b = b + 1
part.Color = Color3.new(a/255, b/255, c/255)
wait()
end
for i = 1, 255 do
b = b - 1
c = c + 1
part.Color = Color3.new(a/255, b/255, c/255)
wait()
end
for i = 1, 255 do
c = c - 1
a = a + 1
part.Color = Color3.new(a/255, b/255, c/255)
wait()
end

--?
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
22 Jul 2011 10:56 PM
Why am I not getting your PM?
Report Abuse
scepile3 is not online. scepile3
Joined: 27 Feb 2009
Total Posts: 260
23 Jul 2011 12:54 AM
Well, the problem with the script was this line:
Value.BorderColor3 = Color3.new(Number1, Number2, Number3)

since the Number variables were more than one. In GUIs, the colors have to be less than/equal to one, so people generally do: #/255

Fixed line:
Value.BorderColor3 = Color3.new(Number1/255, Number2/255, Number3/255)
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