|
| 04 Feb 2012 02:49 PM |
I have been trying to make a GUI that slowly transitions from one color to another. The efforts I have made have gotten me some progress, but below will tell what I need help with.
What it's doing: It starts at a different color, but it does end up with the color I want. (The color it starts at is a subtraction of both destination color and starting color)
What I intended: I wanted the script to start with my selected starting color. That is the only problem I cannot fix.
Script:
local Start_R=159/255 local Start_G=130/255 local Start_B=130/255 ---------------- local End_R=101/255 local End_G=72/255 local End_B=79/255 ---------------- lig = game.Lighting wait(1) print("Started") for i = 0, 1 , 1/255 do !lig.Ambient = Color3.new((Start_R+End_R*i)-End_R,(Start_G+End_G*i)-End_G,(Start_B+End_B*i)-End_B)! wait(1/255) end print("Done")
(! - This means that it is one line of code)
Any solutions? |
|
|
| Report Abuse |
|
|
| |
|
| |
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 04 Feb 2012 04:08 PM |
not sure but try this...
local Start_R=159/255 local Start_G=130/255 local Start_B=130/255 ---------------- local End_R=101/255 local End_G=72/255 local End_B=79/255 ---------------- lig = game.Lighting wait(1) print("Started") for i = 0, 100 do !lig.Ambient = Color3.new((Start_R+((Start_R/End_R)*i)),(Start_G+((Start_G/End_G)*i)),(Start_G+((Start_G/End_G)*i)) wait(1/255) end print("Done")
Actually i have no idea if that will work, just try it! |
|
|
| Report Abuse |
|
|
|
| 04 Feb 2012 04:22 PM |
| I tried your script magnalite, but it made a disco. o.e |
|
|
| Report Abuse |
|
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
|
| 04 Feb 2012 04:28 PM |
:/
local Start_R=159/255 local Start_G=130/255 local Start_B=130/255 ---------------- local End_R=101/255 local End_G=72/255 local End_B=79/255 ---------------- lig = game.Lighting wait(1) print("Started") for i = 0, 100 do !lig.Ambient = Color3.new((Start_R+((Start_R-End_R)*i/100)),(Start_G+((Start_G-End_G)*i/100)),(Start_G+((Start_G-End_G)*i/100)) wait(1/255) end print("Done")
this confuses me a lot :/ |
|
|
| Report Abuse |
|
|