Hi, I'm just learning Scripting and i did this script as example but it doesn't work:
1 | while true do |
2 | wait( 1 ) |
3 | game.Workspace.Lighting.TimeOfDay = "00:00:00" |
4 | wait( 1 ) |
5 | game.Workspace.Lighting.TimeOfDay = "12:00:00" |
6 | wait( 1 ) |
7 | game.Workspace.Lighting.TimeOfDay = "01:00:00" |
8 | end |
I don't get why it doesn't work because it got no red checkmarks, nor blue ones, Please help?
Oh i almost forgot to say that in the Output it prints this: 17:47:51.347 - Stack End 17:47:52.364 - Lighting is not a valid member of Workspace 17:47:52.364 - Script 'Workspace.Script1', Line 3 17:47:52.365 - Stack End
Your problem is that you're trying to access Lighting as a descendant of Workspace. The Lighting property is actually a descendant of the game itself, therefore need to access it using game.Lighting
.
If done correctly, your code should look like this:
1 | while true do |
2 | wait( 1 ) |
3 | game.Lighting.TimeOfDay = "00:00:00" |
4 | wait( 1 ) |
5 | game.Lighting.TimeOfDay = "12:00:00" |
6 | wait( 1 ) |
7 | game.Lighting.TimeOfDay = "01:00:00" |
8 | end |
Ok, well now this should work. If it doesn't, or you have any further problems/questions, please leave a comment below, and I'll see what I can do. Hope I helped :P