|
hi I would like to know how to make it night and day without any buttons .. do you need a timer for it or i dunno can some one help me out ? Because on some games it turn night automaticly then morning again i would like that on my game . |
|
bloob827Join Date: 2010-08-01 Post Count: 6867 |
Script:
game.Lighting.TimeOfDay = 10:00:00 -- change the numbers to whatever the timeofday u want it to be. |
|
|
Do you want it to loop, like a realistic day/night cycle? |
|
|
hi yes i would like to be morning afternoon the dusk ( night) |
|
bloob827Join Date: 2010-08-01 Post Count: 6867 |
while true do
game.Lighting.TimeOfDay = 14:00:00
wait(30)
game.Lighting.TimeOfDay = 07:00:00 -- not sure if this is afternoon :/
wait(30)
game.Lighting.TimeOfDay = 01:00:00
wait(30)
end |
|
AerideynJoin Date: 2010-01-16 Post Count: 1882 |
for i = 0,24 do
for j = 0,60 do
game.Lighting.TimeOfDay = i..":"..j"..:00"
wait(1)
end
end
that will make time pass at 1 minute for each real life second. |
|
AerideynJoin Date: 2010-01-16 Post Count: 1882 |
correction
for i = 0,24 do
for j = 0,60 do
game.Lighting.TimeOfDay = i..":"..j"..":00"
wait(1)
end
end
|
|
|
humm, what do i do where do i put all those numbers ? and when i know where to put em do i have to wait in between ? like 1 minutefor morning 2 minutes for afternoon 1 minute for night and how do i hend do i just pres stop ? so i have to press play and at the end i press pause ? |
|
AerideynJoin Date: 2010-01-16 Post Count: 1882 |
not doing well am i...
for i = 0,24 do
for j = 0,60 do
game.Lighting.TimeOfDay = i..":"..j..":00"
wait(1)
end
end
|
|
|
for i = 0,24 do ( what does i stand for and where do i insert 0.24) ?? |
|
MrNicNacJoin Date: 2008-08-29 Post Count: 28554 |
Use this, it is with the proper functions:
local l = Game["Lighting"]
while wait() do
l:SetMinutesAfterMidnight(l:GetMinutesAfterMidnight() + .5)
end |
|
|
|
Just put that in a script in workspace.
it works. |
|
|
hi i pasted this 'Use this, it is with the proper functions:
local l = Game["Lighting"]
while wait() do
l:SetMinutesAfterMidnight(l:GetMinutesAfterMidnight() + .5)
end' in my script nothing ... |
|
|
AgentFirefoxTop 100 PosterJoin Date: 2008-06-20 Post Count: 22404 |
Do you want REAL time? So the server is night when it's night outside? If so, you can use this (by the way, I don't know the Lighting methods... I'll have to play around with them later):
function getTime()
second_of_day = math.floor(tick() % 86400)
hour = math.floor(second_of_day / 60 / 60) - 12
min = math.floor((second_of_day / 60 / 60 - hour)*60)-720
sec = math.floor(second_of_day - (min+720 + hour*60)*60)
return {hour = math.abs(hour + 12), minute = min, second = sec}
end
repeat wait(4)
local TIME = getTime()
game.Lighting.TimeOfDay = TIME.hour..":"..TIME.minute..":"..TIME.second
until false |
|
|
no i just want it so that its morning ffor 2 minutes then afternoon for2 minute then night for like 3 minutes not in real life you get what i am saying ? and once you have done it do i just put the stuff in a script and it starts to work ? |
|
|
|
CrazyJ114Join Date: 2010-01-16 Post Count: 466 |
This is not a request forum, it's for help, but I'll tell you these 2 functions.
:SetMinutesAfterMidnight()
:GetMinutesAfterMidnight()
Those functions are for lighting, and you can put the getminutes inside the set minutes parenthesies, and add a plus and...er......it's hard to explain...... |
|
|
i dont get it -_- .... do i just put that in a script and there we go ? |
|
bloob827Join Date: 2010-08-01 Post Count: 6867 |
Yes... |
|
|
dont i modifie anything ? in the "() do i put a number ? |
|
SpectrumwJoin Date: 2009-08-04 Post Count: 13510 |
Simon, please, leave the forum and learn how to script. |
|
|
how do i learn how to script .... im a veteran for 2 years i got the visors to proov it but im not a scripter but a great builder .. |
|