A Roblox Community
Would you like to react to this message? Create an account in a few clicks or log in to continue.

A Roblox Community

A community of Robloxians who want to learn to script and build on Roblox Studio.
 
HomeLatest imagesRegisterLog in
If you're a experienced coder make some tutorials! It would really help the site grow.
Make sure you read the rules(Which can be found by clicking here)
If you're a beginner at coding, try some tutorials.
We have many Moderators/Admins watching this site. Contact them with Questions.
Let us know what your favorite sport is. By clicking here to vote (Click here)
This site is becoming inactive. Lets make it active.
Log in
Username:
Password:
Log in automatically: 
:: I forgot my password
Top posters
blueymaddog
Time changing script - Loops forever Vote_lcapTime changing script - Loops forever Voting_barTime changing script - Loops forever Vote_rcap 
naknak
Time changing script - Loops forever Vote_lcapTime changing script - Loops forever Voting_barTime changing script - Loops forever Vote_rcap 
Supernapalm
Time changing script - Loops forever Vote_lcapTime changing script - Loops forever Voting_barTime changing script - Loops forever Vote_rcap 
m27frogy
Time changing script - Loops forever Vote_lcapTime changing script - Loops forever Voting_barTime changing script - Loops forever Vote_rcap 
slayer9365
Time changing script - Loops forever Vote_lcapTime changing script - Loops forever Voting_barTime changing script - Loops forever Vote_rcap 
myrco919
Time changing script - Loops forever Vote_lcapTime changing script - Loops forever Voting_barTime changing script - Loops forever Vote_rcap 
branefreez
Time changing script - Loops forever Vote_lcapTime changing script - Loops forever Voting_barTime changing script - Loops forever Vote_rcap 
ninga95
Time changing script - Loops forever Vote_lcapTime changing script - Loops forever Voting_barTime changing script - Loops forever Vote_rcap 
CloneTrooper787
Time changing script - Loops forever Vote_lcapTime changing script - Loops forever Voting_barTime changing script - Loops forever Vote_rcap 
raboy117
Time changing script - Loops forever Vote_lcapTime changing script - Loops forever Voting_barTime changing script - Loops forever Vote_rcap 
Top posting users this month
No user
Latest topics
» Where to go from here.
Time changing script - Loops forever EmptySeptember 14th 2020, 1:20 pm by MrNicNac

» Send me an Email
Time changing script - Loops forever EmptySeptember 14th 2020, 1:16 pm by MrNicNac

» [v1.6.0.0] Lua Script Obfuscator [No Bytecode]
Time changing script - Loops forever EmptyJuly 6th 2015, 7:38 pm by m27frogy

» New Site Possibly
Time changing script - Loops forever EmptyJuly 6th 2015, 4:16 pm by m27frogy

» Ambassador!
Time changing script - Loops forever EmptyApril 15th 2015, 11:40 pm by naknak

» Boop - Tag
Time changing script - Loops forever EmptyApril 13th 2015, 9:46 pm by naknak

» Vip Class Script
Time changing script - Loops forever EmptyApril 13th 2015, 4:54 pm by naknak

» Who's active?!
Time changing script - Loops forever EmptyApril 13th 2015, 4:52 pm by naknak

» Genesis Point
Time changing script - Loops forever EmptyJuly 17th 2014, 7:04 pm by branefreez

» Reward System
Time changing script - Loops forever EmptyJuly 17th 2014, 5:41 am by m27frogy

» Script Request
Time changing script - Loops forever EmptyJuly 10th 2014, 11:43 am by naknak

» local scripts?
Time changing script - Loops forever EmptyJuly 10th 2014, 11:39 am by naknak

» Project: Reconstruction [Died]
Time changing script - Loops forever EmptyJuly 10th 2014, 11:36 am by naknak

» Hi. I am new here
Time changing script - Loops forever EmptyApril 26th 2014, 4:01 pm by altshiftkey

» What's your favorite sport?
Time changing script - Loops forever EmptyJanuary 1st 2014, 2:13 pm by m27frogy

» FlashLight Script
Time changing script - Loops forever EmptyJanuary 1st 2014, 2:11 pm by m27frogy

» Gun Making! [READ DESC]
Time changing script - Loops forever EmptyJanuary 1st 2014, 2:10 pm by m27frogy

» Hi, I am new here!
Time changing script - Loops forever EmptyNovember 26th 2013, 3:33 pm by Keanu73

» Improve Coding
Time changing script - Loops forever EmptyOctober 26th 2013, 1:12 pm by pook03

» Simple Button
Time changing script - Loops forever EmptySeptember 1st 2013, 6:19 pm by branefreez


 

 Time changing script - Loops forever

Go down 
5 posters
AuthorMessage
Prodigy
Administrator
Administrator
avatar


Posts : 58
Join date : 2010-07-28

Time changing script - Loops forever Empty
PostSubject: Time changing script - Loops forever   Time changing script - Loops forever EmptyAugust 3rd 2010, 12:33 pm

Code:
speed = 2 --Sets the speed of the time changing.
sec = 0
min = 0
hour = 0
while true do
   game.Lighting.TimeOfDay = ""..hour..":"..min..":"..sec.."" --The time of day is equal to the amount of hours, minutes, and seconds.
   sec = sec + (5*speed) --Add 5*Speed to the seconds value. Meaning, add 10 seconds to the time.

   if sec >= 60 then --If the seconds value is equal to or more than 60
      sec = 0 --make seconds equal to zero and
      min = min + 1 --Add a minute to the minute value
   end

   if min >= 60 then --If the minutes value is equal to or more than 60
      min = 0 --make the amount of minutes equal to zero and
      hour = hour + 1 --add one hour to the hour value
   end

   if hour >= 24 then --if the hours value is equal to or more than 24
      hour = 0 --make the ammount of hours equal to zero and restart the script
   end

   wait(0.05) --Run the script every 5 mili-seconds
end
Back to top Go down
http://roblox.forumclan.com
naknak
Administrator
Administrator
naknak


Posts : 878
Join date : 2010-07-30

Time changing script - Loops forever Empty
PostSubject: Re: Time changing script - Loops forever   Time changing script - Loops forever EmptyAugust 3rd 2010, 10:21 pm

You could make it slightly more effeicent....
Code:
speed = 2 --Sets the speed of the time changing.
local sec = 0
local min = 0
local hour = 0
while wait(.05) do
  game.Lighting.TimeOfDay = ""..hour..":"..min..":"..sec.."" --The time of day is equal to the amount of hours, minutes, and seconds.
  sec = sec + (5*speed) --Add 5*Speed to the seconds value. Meaning, add 10 seconds to the time.

  if sec >= 60 then --If the seconds value is equal to or more than 60
      sec = 0 --make seconds equal to zero and
      min = min + 1 --Add a minute to the minute value
  end

  if min >= 60 then --If the minutes value is equal to or more than 60
      min = 0 --make the amount of minutes equal to zero and
      hour = hour + 1 --add one hour to the hour value
  end

  if hour >= 24 then --if the hours value is equal to or more than 24
      hour = 0 --make the ammount of hours equal to zero and restart the script
  end
end
Back to top Go down
Prodigy
Administrator
Administrator
avatar


Posts : 58
Join date : 2010-07-28

Time changing script - Loops forever Empty
PostSubject: Re: Time changing script - Loops forever   Time changing script - Loops forever EmptyAugust 7th 2010, 3:32 pm

It's the same exact thing... It doesn't make it more efficient or less efficient.
Back to top Go down
http://roblox.forumclan.com
naknak
Administrator
Administrator
naknak


Posts : 878
Join date : 2010-07-30

Time changing script - Loops forever Empty
PostSubject: Re: Time changing script - Loops forever   Time changing script - Loops forever EmptyAugust 8th 2010, 1:02 am

you would save more time and effort my way...
Back to top Go down
Prodigy
Administrator
Administrator
avatar


Posts : 58
Join date : 2010-07-28

Time changing script - Loops forever Empty
PostSubject: Re: Time changing script - Loops forever   Time changing script - Loops forever EmptyAugust 8th 2010, 10:26 am

naknak wrote:
you would save more time and effort my way...
Okay... but typing four extra letters isn't time consuming and doesn't take any effort.
Back to top Go down
http://roblox.forumclan.com
Guest
Guest
avatar



Time changing script - Loops forever Empty
PostSubject: Re: Time changing script - Loops forever   Time changing script - Loops forever EmptyAugust 8th 2010, 8:12 pm

You can not only shorten it, but make it MUCH neater and efficent.

Code:
 --I remembered the block xD
Speed = 2
while true do
game.Lighting:SetMinutesAfterMidnight(game.Lighting:GetMinutesAfterMidnight() + Speed / 60)
wait(0.05)
end
Back to top Go down
naknak
Administrator
Administrator
naknak


Posts : 878
Join date : 2010-07-30

Time changing script - Loops forever Empty
PostSubject: Re: Time changing script - Loops forever   Time changing script - Loops forever EmptyAugust 9th 2010, 10:14 pm

I think voidhack wins...
Back to top Go down
Guest
Guest
avatar



Time changing script - Loops forever Empty
PostSubject: Re: Time changing script - Loops forever   Time changing script - Loops forever EmptyAugust 10th 2010, 3:15 pm

I think I win also. I remembered the code for adding code xD
Back to top Go down
Supernapalm
Expert Scripter
Expert Scripter
avatar


Posts : 393
Join date : 2011-01-17

Time changing script - Loops forever Empty
PostSubject: Re: Time changing script - Loops forever   Time changing script - Loops forever EmptyJanuary 18th 2011, 10:10 pm

is this just a time changing thing for the lighting? if it is, who would want to use it?
Back to top Go down
http://hackthissite.org
naknak
Administrator
Administrator
naknak


Posts : 878
Join date : 2010-07-30

Time changing script - Loops forever Empty
PostSubject: Re: Time changing script - Loops forever   Time changing script - Loops forever EmptyJanuary 18th 2011, 10:15 pm

To make your map have day and night.
Back to top Go down
Supernapalm
Expert Scripter
Expert Scripter
avatar


Posts : 393
Join date : 2011-01-17

Time changing script - Loops forever Empty
PostSubject: Re: Time changing script - Loops forever   Time changing script - Loops forever EmptyJanuary 18th 2011, 10:21 pm

the point is that i do not want a day and night script
Back to top Go down
http://hackthissite.org
blueymaddog
Administrator
Administrator
blueymaddog


Posts : 1081
Join date : 2010-12-09
Age : 26

Time changing script - Loops forever Empty
PostSubject: Re: Time changing script - Loops forever   Time changing script - Loops forever EmptyJanuary 20th 2011, 6:53 pm

the point is that others might want it.
Back to top Go down
naknak
Administrator
Administrator
naknak


Posts : 878
Join date : 2010-07-30

Time changing script - Loops forever Empty
PostSubject: Re: Time changing script - Loops forever   Time changing script - Loops forever EmptyJanuary 20th 2011, 7:10 pm

Exactly
Back to top Go down
blueymaddog
Administrator
Administrator
blueymaddog


Posts : 1081
Join date : 2010-12-09
Age : 26

Time changing script - Loops forever Empty
PostSubject: Re: Time changing script - Loops forever   Time changing script - Loops forever EmptyJanuary 24th 2011, 9:04 am

lol I win.
Back to top Go down
slayer9365
Expert Scripter
Expert Scripter
slayer9365


Posts : 233
Join date : 2010-07-31
Age : 29

Time changing script - Loops forever Empty
PostSubject: Re: Time changing script - Loops forever   Time changing script - Loops forever EmptyJanuary 24th 2011, 9:08 pm

Actually voidhack still wins.
Back to top Go down
naknak
Administrator
Administrator
naknak


Posts : 878
Join date : 2010-07-30

Time changing script - Loops forever Empty
PostSubject: Re: Time changing script - Loops forever   Time changing script - Loops forever EmptyJanuary 24th 2011, 10:08 pm

Code:
S = 2
while wait(.05) do
game.Lighting:SetMinutesAfterMidnight(game.Lighting:GetMinutesAfterMidnight()+S/60)
end


hmm...
Back to top Go down
Supernapalm
Expert Scripter
Expert Scripter
avatar


Posts : 393
Join date : 2011-01-17

Time changing script - Loops forever Empty
PostSubject: Re: Time changing script - Loops forever   Time changing script - Loops forever EmptyJanuary 24th 2011, 10:37 pm

Code:
while wait(0.05) do
game.Lighting:SetMinutesAfterMidnight(game.Lighting:GetMinutesAfterMidnight()+%Speed%/60)
end
you don't need a variable, that saves time and, for this exception, space
Back to top Go down
http://hackthissite.org
blueymaddog
Administrator
Administrator
blueymaddog


Posts : 1081
Join date : 2010-12-09
Age : 26

Time changing script - Loops forever Empty
PostSubject: Re: Time changing script - Loops forever   Time changing script - Loops forever EmptyJanuary 26th 2011, 10:40 am

lol, why would make a fuss over the smallest things? =P
Back to top Go down
Sponsored content





Time changing script - Loops forever Empty
PostSubject: Re: Time changing script - Loops forever   Time changing script - Loops forever Empty

Back to top Go down
 
Time changing script - Loops forever
Back to top 
Page 1 of 1
 Similar topics
-
» Loops, loops, loops....
» changing my picture?
» Tutorial on: 'for' loops
» Changing the color legend a bit
» War beyond time

Permissions in this forum:You cannot reply to topics in this forum
A Roblox Community :: Tutorials and Resources :: Free Scripts-
Jump to: