|
| 08 Jan 2012 09:35 PM |
I need some help with changing the FogColor to change during TimeofDay, But the scripts don't seem to work, The script below is the change time of day script. =============================================================================== local speed = 150
time = game:service("Lighting"):GetMinutesAfterMidnight()
local full = 60 * 60 * 12
while true do time = (time + (wait()/60)*speed) game:service("Lighting"):SetMinutesAfterMidnight(time) if time >= full then time = time - full end end ------------------------------------------------------------------------------------------------------------------------------- The next script is supposed to change the FogColor during Midnight, Although I can't seem to figure it out, I have Tried to change FogEnd to FogColor, Although it didn't work. -------------------------------------------------------------------------------------------------------------------------------
game.Lighting.Changed:connect(function() local t = game.Lighting:GetMinutesAfterMidnight() game.Lighting.FogEnd = (t < 392 and t > 359) and 50 or 10000 end)
while wait(.5) do game.Lighting:SetMinutesAfterMidnight(game.Lighting:GetMinutesAfterMidnight() + 1) end |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
iJake123
|
  |
| Joined: 23 Mar 2010 |
| Total Posts: 206 |
|
|
| 09 Jan 2012 06:44 PM |
| What's the problem? Add outputs to see when it fails. |
|
|
| Report Abuse |
|
|
|
| 09 Jan 2012 06:58 PM |
@iJake The problem is that on the second script I tried editing it, by changing the FogEnd to FogColor, and added the correct color for the dark color of the fog (8;8;8) to make it change the FogColor but, it didn't work. Also the script I put for the second script is the original. |
|
|
| Report Abuse |
|
|
| |
|
RA2lover
|
  |
| Joined: 09 Nov 2008 |
| Total Posts: 1254 |
|
|
| 10 Jan 2012 03:27 AM |
| AFAIK FogEnd is a number value, and it looks like you're trying to feed a bool value to it. |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2012 06:23 AM |
RA2 he's "feeding" a number into it:
print(1 == 1 and 2 or 3)
Will that print a bool value? -.- Its a syntactical sugar, ternary I think is the name (not sure), its a short way of doing:
print(function() if 1 == 1 then return 2 else return 3 end end)() |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2012 03:36 PM |
| So what exactly would I have to do in order to make it to change the fog color from (243;243;243) during until 18:00 then the fogcolor changes to (8;8;8) until 6:00? |
|
|
| Report Abuse |
|
|
| |
|
Quenty
|
  |
| Joined: 03 Sep 2009 |
| Total Posts: 9316 |
|
|
| 11 Jan 2012 12:07 AM |
Your notation/syntext *SP FAIL*, are all weird.
game.Lighting.FogEnd = (t < 392 and t > 359) and 50 or 10000
I presume the above line sets the fogend, to 50 if t is less then 392, and 359 if greater then.
For fog color, you can do.
game.Lighting.FogColor = Color3.new(REDCOLORNUM/255, GREENCOLORNUM/255, BLUECOLORNUM/255)
Obviously, you will have to change the 'REDCOLORNUM', ect. |
|
|
| Report Abuse |
|
|
|
| 11 Jan 2012 02:04 AM |
It resulted in a error once again, I tried to edit the script making it this: game.Lighting.Changed:connect(function() local t = game.Lighting:GetMinutesAfterMidnight() game.Lighting.FogColor = Color3.new(REDCOLORNUM/8, GREENCOLORNUM/8, BLUECOLORNUM/8) end)
while wait(.5) do game.Lighting:SetMinutesAfterMidnight(game.Lighting:GetMinutesAfterMidnight() + 1) end
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
Quenty
|
  |
| Joined: 03 Sep 2009 |
| Total Posts: 9316 |
|
|
| 11 Jan 2012 10:25 PM |
No no no. Edit the capitalized letters, not the numbers. Here's a sample:
game.Lighting.FogColor = Color3.new(155/255, 1/255, 54/255)
|
|
|
| Report Abuse |
|
|
|
| 11 Jan 2012 10:29 PM |
| @Quenty exactly how would you find the first color for the FogColor? |
|
|
| Report Abuse |
|
|
Quenty
|
  |
| Joined: 03 Sep 2009 |
| Total Posts: 9316 |
|
|
| 11 Jan 2012 10:30 PM |
It's a color3 value.
http://wiki.roblox.com/index.php/Color3 |
|
|
| Report Abuse |
|
|
|
| 11 Jan 2012 10:41 PM |
Still resulted in an error, this time I tried this: game.Lighting.Changed:connect(function() local t = game.Lighting:GetMinutesAfterMidnight() game.Lighting.FogColor = Color3.new(25/255, 25/255, 25/255) end)
while wait(.5) do game.Lighting:SetMinutesAfterMidnight(game.Lighting:GetMinutesAfterMidnight() + 1) end
|
|
|
| Report Abuse |
|
|
| |
|
|
| 13 Jan 2012 01:59 AM |
This one will defenatly work. I use it all the time.
local h = Instance.new("Hint") h.Parent = game.Workspace
minutes = 0 hour = 6 while true do minutes = minutes + 1 if minutes == 60 then minutes = 0 hour = hour + 1 end
if hour == 24 then hour = 0 minutes = 0 end
if hour == 24 then game.Lighting.FogEnd = "Your Number Here" -- You must put it inbetween the " " game.Lighting.FogColor = "Your Color Here" -- You must put it inbetween the " " end if minutes < 10 and hour < 10 then game.Lighting.TimeOfDay = ("0"..hour..":0"..minutes..":00") h.Text = ("0"..hour..":0"..minutes.."") end if minutes < 10 and hour >= 10 then game.Lighting.TimeOfDay = (""..hour..":0"..minutes..":00") h.Text = (""..hour..":0"..minutes.."") end if minutes >= 10 and hour < 10 then game.Lighting.TimeOfDay = ("0"..hour..":"..minutes..":00") h.Text = ("0"..hour..":"..minutes.."") end if minutes >= 10 and hour >= 10 then game.Lighting.TimeOfDay = (""..hour..":"..minutes..":00") h.Text = (""..hour..":"..minutes.."") end wait(1) -- This is the only thing that you can change. This changes the speed of which the minutes change. end
you can add other things like:
if hour == 10 then something happens here end
|
|
|
| Report Abuse |
|
|
|
| 01 Feb 2012 06:41 PM |
@IAm The time freezes during 10:00 |
|
|
| Report Abuse |
|
|