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: I need some help editing this script

Previous Thread :: Next Thread 
evilspartan9000 is not online. evilspartan9000
Joined: 09 Apr 2010
Total Posts: 10655
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
evilspartan9000 is not online. evilspartan9000
Joined: 09 Apr 2010
Total Posts: 10655
09 Jan 2012 11:11 AM
Bump
Report Abuse
evilspartan9000 is not online. evilspartan9000
Joined: 09 Apr 2010
Total Posts: 10655
09 Jan 2012 12:24 PM
Bump
Report Abuse
evilspartan9000 is not online. evilspartan9000
Joined: 09 Apr 2010
Total Posts: 10655
09 Jan 2012 03:10 PM
Bump again XP
Report Abuse
evilspartan9000 is not online. evilspartan9000
Joined: 09 Apr 2010
Total Posts: 10655
09 Jan 2012 03:44 PM
Anyone?
Report Abuse
evilspartan9000 is not online. evilspartan9000
Joined: 09 Apr 2010
Total Posts: 10655
09 Jan 2012 05:39 PM
Can anyone help?
Report Abuse
evilspartan9000 is not online. evilspartan9000
Joined: 09 Apr 2010
Total Posts: 10655
09 Jan 2012 06:38 PM
Bump again
Report Abuse
iJake123 is not online. 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
evilspartan9000 is not online. evilspartan9000
Joined: 09 Apr 2010
Total Posts: 10655
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
evilspartan9000 is not online. evilspartan9000
Joined: 09 Apr 2010
Total Posts: 10655
10 Jan 2012 03:02 AM
Bump again
Report Abuse
RA2lover is not online. 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
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
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
evilspartan9000 is not online. evilspartan9000
Joined: 09 Apr 2010
Total Posts: 10655
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
evilspartan9000 is not online. evilspartan9000
Joined: 09 Apr 2010
Total Posts: 10655
11 Jan 2012 12:02 AM
Bump
Report Abuse
Quenty is not online. 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
evilspartan9000 is not online. evilspartan9000
Joined: 09 Apr 2010
Total Posts: 10655
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
evilspartan9000 is not online. evilspartan9000
Joined: 09 Apr 2010
Total Posts: 10655
11 Jan 2012 05:02 PM
Bump
Report Abuse
evilspartan9000 is not online. evilspartan9000
Joined: 09 Apr 2010
Total Posts: 10655
11 Jan 2012 10:22 PM
Bump again XP
Report Abuse
Quenty is not online. 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
evilspartan9000 is not online. evilspartan9000
Joined: 09 Apr 2010
Total Posts: 10655
11 Jan 2012 10:29 PM
@Quenty exactly how would you find the first color for the FogColor?
Report Abuse
Quenty is not online. 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
evilspartan9000 is not online. evilspartan9000
Joined: 09 Apr 2010
Total Posts: 10655
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
evilspartan9000 is not online. evilspartan9000
Joined: 09 Apr 2010
Total Posts: 10655
12 Jan 2012 10:53 PM
Bump
Report Abuse
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
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
evilspartan9000 is not online. evilspartan9000
Joined: 09 Apr 2010
Total Posts: 10655
01 Feb 2012 06:41 PM
@IAm
The time freezes during 10:00
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