Hi, I'm just learning Scripting and i did this script as example but it doesn't work:
while true do wait(1) game.Workspace.Lighting.TimeOfDay = "00:00:00" wait(1) game.Workspace.Lighting.TimeOfDay = "12:00:00" wait(1) game.Workspace.Lighting.TimeOfDay = "01:00:00" 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:
while true do wait(1) game.Lighting.TimeOfDay = "00:00:00" wait(1) game.Lighting.TimeOfDay = "12:00:00" wait(1) game.Lighting.TimeOfDay = "01:00:00" 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