|
| 30 Jul 2011 03:36 PM |
I don't want to set a time as string like "14:00:00".
I seen somebody do it before using a
for i = 1,[#seconds in a day]. --complicated stuff. end |
|
|
| Report Abuse |
|
|
WishNite
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 15828 |
|
|
| 30 Jul 2011 03:46 PM |
SetMinutesAfterMidnight(60)
would mean 01:00:00. |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2011 03:49 PM |
Is there anyway to set TimeOfDay value like a number? I tried:
Time = game:service("Lighting")
while true do wait(.5) Time:SetMinutesAfterMidnight(Time:GetMinutesAfterMidnight()+1) if Time:GetMinutesAfterMidnight() >= "17:00" then Time.ColorShift_Bottom = Time.ColorShift_Bottom +Color3.new(1,0,0) if Time:GetMinutesAfterMidnight() >= "19:00" then Time.ColorShift_Bottom = Color3.new(0,0,0) end end end |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2011 03:51 PM |
If you want output:
Workspace.Day and Night Script:6: attempt to compare string with number
So is there anyway to get the value of Time:GetMinutesAfterMidnight()? |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2011 03:59 PM |
Derp. Barely anyone is helping.
Workspace.Day and Night Script:7: attempt to perform arithmetic on field 'ColorShift_Bottom' (a userdata value)
Time = game:service("Lighting")
while true do wait(.5) Time:SetMinutesAfterMidnight(Time:GetMinutesAfterMidnight()+1) if Time:GetMinutesAfterMidnight() >= 960 then Time.ColorShift_Bottom = Time.ColorShift_Bottom +Color3.new(1,0,0) if Time:GetMinutesAfterMidnight() >= 1140 then Time.ColorShift_Bottom.Color = Color3.new(0,0,0) --Line 7 end end end |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2011 03:59 PM |
| I am sure there was another function to set minutes after midnight. Forgot it... Give me a minute... |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2011 04:00 PM |
Here. I think you wanted this one:
http://wiki.roblox.com/index.php/SetMinutesAfterMidnight_%28Method%29 |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2011 04:01 PM |
| Uhh, it's ok. I'm more worried about how to set the Color of ColorShift_Bottom |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2011 04:06 PM |
You can't add Color3 values. You have to do arithmetic on the numbers that make up the Color3s (r, g, and b).
local old = Time.ColorShift_Bottom Time.ColorShift_Bottom = Color3.new(old.r + 1, old.g, old.b)
~Sorcus |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2011 04:11 PM |
| It instantly sts the Red value to 255. |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2011 04:13 PM |
That's because Color3 works on a scale of 0 to 1, unlike what the properties window shows.
Color3.new(old.r + (1/255), old.g, old.b)
~Sorcus |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2011 04:14 PM |
By the way, to set TimeOfDay with values, you'd need the hh:mm:ss format.
Ex:
game.Lighting.TimeOfDay = "17:00:00" |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2011 04:18 PM |
You can set the TimeOfDay property like this:
game.Lighting.TimeOfDay = 4 -- 4:00:00 |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2011 04:19 PM |
Really? That's interesting.
hh:mm doesn't work, though(?). It at least didn't back when I worked with TimeOfDay back in 08, as I can remember. |
|
|
| Report Abuse |
|
|
| |
|
|
| 30 Jul 2011 04:23 PM |
| Hnm, okay. I guess I should refresh my knowledge a bit. |
|
|
| Report Abuse |
|
|