I want to disable global shadows at night and enable it at the morning.
01 | while true do |
02 | end |
03 | wait() |
04 | if game.Lighting.TimeOfDay = = "06:30:00" |
05 | then end |
06 | game.Lighting.GlobalShadows = true |
07 |
08 | if game.Lighting.ClockTime = = "18:00:00" |
09 | then |
10 | game.Lighting.GlobalShadows = false |
11 |
12 | end |
Hello, TheLondiux!
I've found lots of errors on your script:
1 - Use end
to close a block of code, like a while
, if
, or any other code blocks that you need to close
2 - You don't need to place the then on the next line, it just makes your code harder to read
3 - If the object at game.Lighting.TimeOfDay
is a value, you should add a .Value
to gets it's value...
01 | while true do -- Loop Starts here |
02 | wait() |
03 | if game.Lighting.TimeOfDay = = 06.5 then -- 6:30 -- First IF starts here |
04 | game.Lighting.GlobalShadows = true |
05 | end -- First IF ends here |
06 |
07 | if game.Lighting.ClockTime = = 18 then -- 18 -- Second IF starts here |
08 | game.Lighting.GlobalShadows = false |
09 | end -- Second IF ends here |
10 | end -- Loop ends here |
Also, Scripting Helpers is not a place where you place a random script and we give you the answer, please post something that make sense with the question
Hope this helps
Good Luck with your games
Is this what you want to do?
Im new to scripting but here you go
01 | while wait( 1 ) do |
02 | warn( "OKASD" ) |
03 | if game.Lighting.TimeOfDay = = 6.5 then --"06:30:00" |
04 | game.Lighting.GlobalShadows = true |
05 | print ( "GlobShadows On" ) |
06 | elseif game.Lighting.ClockTime = = 18 then --"18:00:00" |
07 | game.Lighting.GlobalShadows = false |
08 | print ( "GlobShadows Off" ) |
09 | end |
10 | end |
You can delete the (print) lines thats for when you add your time system i am guessing