|
| 21 Oct 2011 04:31 PM |
im trying to play with the brightness of my place, i can make it going brighter until 12pm, but after this, i really don't know hiw to do it... here is my script
time = game:service("Lighting"):GetMinutesAfterMidnight() if(time<720) then game:service("Lighting").Brightness = (time/720) --720 minutes is 12h else --math to make so it will decrease the lightning end |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
|
| 21 Oct 2011 05:45 PM |
brightness = (720-(time-720))/720
720-(14 40-720) = 720-720 = 0 (the space is there because the filters are so freaking dumb its not even funny >_<)
so at midnight brightness = 0
720-(721-720) = 720-1 = 719
at a minute after noon brightness = just under 1 (719/720) |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2011 06:02 PM |
that worked, thank you
but now, how would i make something like this efficiently that don't go darker than color3(40, 40, 40) ? this is what i've got now
if(time<720) then game:service("Lighting").Brightness = (time/720) --720 minutes is 12h game:service("Lighting").Ambient = Color3.new(((time)/720), ((time)/720), ((time)/720)) else game:service("Lighting").Brightness = (720-(time-720))/720 game:service("Lighting").Ambient = Color3.new((720-(time-720))/720, (720-(time-720))/720, (720-(time-720))/720) end |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
hillow25
|
  |
| Joined: 20 Jan 2009 |
| Total Posts: 125 |
|
|
| 21 Oct 2011 09:38 PM |
| So you want it to down after 12 (720)? |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2011 10:29 PM |
yes, but i got it to work.. i dont know if it is possible to make it more efficient, but here is my script :
while true do time = game:service("Lighting"):GetMinutesAfterMidnight() game:service("Lighting"):SetMinutesAfterMidnight(time + 0.5) if(time<720) then game:service("Lighting").Brightness = (time/720) --720 minutes is 12h if(time>107.29411764705882352941176470588) then --this long number, when passing in the color3 value, will result in 38 in the lighting property game:service("Lighting").Ambient = Color3.new(((time)/720), ((time)/720), ((time)/720)) end else game:service("Lighting").Brightness = (720-(time-720))/720 if(720-(time-720)>107.29411764705882352941176470588) then --this long number, when passing in the color3 value, will result in 38 in the lighting property game:service("Lighting").Ambient = Color3.new((720-(time-720))/720, (720-(time-720))/720, (720-(time-720))/720) end end wait(0.25) end
|
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Oct 2011 01:15 AM |
With all those bump, question may not be clear. I want to know how i could optimised this script :
while true do time = game:service("Lighting"):GetMinutesAfterMidnight() game:service("Lighting"):SetMinutesAfterMidnight(time + 0.5) if(time<720) then game:service("Lighting").Brightness = (time/720) --720 minutes is 12h if(time>107.29411764705882352941176470588) then --this long number, when passing in the color3 value, will result in 38 in the lighting property game:service("Lighting").Ambient = Color3.new(((time)/720), ((time)/720), ((time)/720)) end else game:service("Lighting").Brightness = (720-(time-720))/720 if(720-(time-720)>107.29411764705882352941176470588) then --this long number, when passing in the color3 value, will result in 38 in the lighting property game:service("Lighting").Ambient = Color3.new((720-(time-720))/720, (720-(time-720))/720, (720-(time-720))/720) end end wait(0.25) end |
|
|
| Report Abuse |
|
|
| |
|
| |
|
NBCKing
|
  |
| Joined: 09 Oct 2011 |
| Total Posts: 133 |
|
| |
|