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
 

math question

Previous Thread :: Next Thread 
moustachauve is not online. moustachauve
Joined: 29 Jul 2009
Total Posts: 668
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
moustachauve is not online. moustachauve
Joined: 29 Jul 2009
Total Posts: 668
21 Oct 2011 05:04 PM
Bump
Report Abuse
moustachauve is not online. moustachauve
Joined: 29 Jul 2009
Total Posts: 668
21 Oct 2011 05:35 PM
Up. Anyone have an idea?
Report Abuse
darkjunior is not online. darkjunior
Joined: 05 Sep 2008
Total Posts: 2224
21 Oct 2011 05:39 PM
[ Content Deleted ]
Report Abuse
crazypotato4 is not online. crazypotato4
Joined: 22 Feb 2010
Total Posts: 20000
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
moustachauve is not online. moustachauve
Joined: 29 Jul 2009
Total Posts: 668
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
moustachauve is not online. moustachauve
Joined: 29 Jul 2009
Total Posts: 668
21 Oct 2011 06:29 PM
Up please
Report Abuse
moustachauve is not online. moustachauve
Joined: 29 Jul 2009
Total Posts: 668
21 Oct 2011 06:58 PM
Little bump
Report Abuse
moustachauve is not online. moustachauve
Joined: 29 Jul 2009
Total Posts: 668
21 Oct 2011 07:23 PM
big bump?
Report Abuse
hillow25 is not online. 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
moustachauve is not online. moustachauve
Joined: 29 Jul 2009
Total Posts: 668
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
moustachauve is not online. moustachauve
Joined: 29 Jul 2009
Total Posts: 668
22 Oct 2011 12:49 AM
Bump
Report Abuse
moustachauve is not online. moustachauve
Joined: 29 Jul 2009
Total Posts: 668
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
moustachauve is not online. moustachauve
Joined: 29 Jul 2009
Total Posts: 668
22 Oct 2011 10:59 AM
Bump
Report Abuse
moustachauve is not online. moustachauve
Joined: 29 Jul 2009
Total Posts: 668
22 Oct 2011 05:48 PM
Bum please
Report Abuse
NBCKing is not online. NBCKing
Joined: 09 Oct 2011
Total Posts: 133
22 Oct 2011 05:48 PM
Bump
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