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: Highly inefficient way of using math?

Previous Thread :: Next Thread 
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
21 Jun 2012 09:27 PM
I'm making a complicated Day/Night script, just for fun.
I want it to change the time of day every second, as in

00:00:01
wait(0.1)
00:00:02

And that will take forever. Any way to get around this using some groovy math?








~Leave me in the city with 50 bucks and watch me come back a millionaire~
Report Abuse
WhiteRain is not online. WhiteRain
Joined: 24 Apr 2010
Total Posts: 2723
21 Jun 2012 09:30 PM
Loops that add 1 second for every iteration
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
21 Jun 2012 09:31 PM
Aww....

I wanted to use math qq

Well, what type of loop should I use?






~Leave me in the city with 50 bucks and watch me come back a millionaire~
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
21 Jun 2012 09:32 PM
while wait(1) do
game.Lighting:SetMinutesAfterMidnight(game.Lighting:GetMinutesAfterMidnight() + 1)
end
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
21 Jun 2012 09:33 PM
Doesn't that cause the skybox to move like a stop motion movie?
I literally want it to change the TimeOfDay for every second, to make it ultra-realistic...










~Leave me in the city with 50 bucks and watch me come back a millionaire~
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
21 Jun 2012 09:36 PM
You can even change the wait from 1 to .1 and I'm pretty sure you will not even notice the movement of the sun until several seconds later.
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
21 Jun 2012 09:37 PM
So you're saying that either way, the skybox is going to look like crap, basically?


if that_statement == true then
ScriptingHelpers.GreenDay987 = Sad
else
ScriptingHelpers.GreenDay987 = Happy







~Leave me in the city with 50 bucks and watch me come back a millionaire~
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
21 Jun 2012 09:38 PM
SH is so slow right now .-.






~Leave me in the city with 50 bucks and watch me come back a millionaire~
Report Abuse
WhiteRain is not online. WhiteRain
Joined: 24 Apr 2010
Total Posts: 2723
21 Jun 2012 09:40 PM
if that_statement == true then
ScriptingHelpers.GreenDay987 = Sad
else
ScriptingHelpers.GreenDay987 = Happy
end <--Forgot this
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
21 Jun 2012 09:41 PM
:o

lol


Anyway, would it just work better to change the skybox second by second ​>_>






~Leave me in the city with 50 bucks and watch me come back a millionaire~
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
21 Jun 2012 09:41 PM
No, what I'm saying is that the sun will move really slowly which will look as realistic as you want.
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
21 Jun 2012 09:41 PM
Oh ok.

Thanks :D


By the way, sorry for being off-topic, but any idea what ambiance is?






~Leave me in the city with 50 bucks and watch me come back a millionaire~
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
21 Jun 2012 09:42 PM
Ambience


xD Spellcheck





~Leave me in the city with 50 bucks and watch me come back a millionaire~
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
21 Jun 2012 09:43 PM
It changes the color of the global lighting in Workspace.
Report Abuse
WhiteRain is not online. WhiteRain
Joined: 24 Apr 2010
Total Posts: 2723
21 Jun 2012 09:44 PM
Ambiance is the color that is spread across the map. Usually its just a midgrayish color. Sometimes people change it to like red or something for a more apocalyptic feel and such.
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
21 Jun 2012 09:44 PM
Ah... ok.

So how would I access it via script?
I would like to change it according to the time of day.





~Leave me in the city with 50 bucks and watch me come back a millionaire~
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
21 Jun 2012 10:17 PM
My god....
I tried Spectrum's script out, and it was so slow, I barely saw the sun move at all.

I think the Time changed by 6 second intervals, that's enough for me.
Thanks.





~Leave me in the city with 50 bucks and watch me come back a millionaire~
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
21 Jun 2012 10:19 PM
game.Lighting.Ambiance = Color3.new(math.random(), math.random(), math.random())
Report Abuse
GreenDay987 is not online. GreenDay987
Joined: 21 May 2011
Total Posts: 7027
21 Jun 2012 10:20 PM
Alrighty, thanks.






~Leave me in the city with 50 bucks and watch me come back a millionaire~
Report Abuse
Ubayla is not online. Ubayla
Joined: 01 Dec 2008
Total Posts: 157
21 Jun 2012 11:22 PM
You could always change the time to the internal clock... But that would be too fun.
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