Time of day = Script Disables? [ANSWERED]
So. I have a script in which when the time reaches 21:00:00, or 9pm, the scripts to open a gate stop working and then when the time reached 6:00:00 it re-activates.... BUT, it doesn't work, could someone help?
So. I have 3 different codes which all don't work, making even 1 of them work would be a miracle
01 | game.Lighting.LightingChanged:connect( function (TimeOfDay) |
03 | game.Workspace.Security.Rear.Open.R.Enabled = false |
04 | game.Workspace.Security.Rear.Open.L.Enabled = false |
05 | game.Workspace.Security.Front.Open.R.Enabled = false |
06 | game.Workspace.Security.Front.Open.L.Enabled = false |
08 | game.Workspace.Security.Rear.Open.R.Enabled = true |
09 | game.Workspace.Security.Rear.Open.L.Enabled = true |
10 | game.Workspace.Security.Front.Open.R.Enabled = true |
11 | game.Workspace.Security.Front.Open.L.Enabled = true |
01 | if game.Lighting.TimeOfDay = = "21:00:00" then |
02 | game.Workspace.Security.Rear.Open.R.Enabled = false |
03 | game.Workspace.Security.Rear.Open.L.Enabled = false |
04 | game.Workspace.Security.Front.Open.R.Enabled = false |
05 | game.Workspace.Security.Front.Open.L.Enabled = false |
07 | elseif game.Lighting.TimeOfDay = = "06:00:00" then |
08 | game.Workspace.Security.Rear.Open.R.Enabled = true |
09 | game.Workspace.Security.Rear.Open.L.Enabled = true |
10 | game.Workspace.Security.Front.Open.R.Enabled = true |
11 | game.Workspace.Security.Front.Open.L.Enabled = true |
01 | game.Lighting.TimeOfDay.Changed:connect( function () |
02 | if game.Lighting.TimeOfDay = = "21:00:00" then |
03 | game.Workspace.Security.Rear.Open.R.Disabled = true |
04 | game.Workspace.Security.Rear.Open.L.Disabled = true |
05 | game.Workspace.Security.Front.Open.R.Disabled = true |
06 | game.Workspace.Security.Front.Open.L.Disabled = true |
08 | elseif game.Lighting.TimeOfDay = = "6:00:00" then |
09 | game.Workspace.Security.Rear.Open.R.Disabled = false |
10 | game.Workspace.Security.Rear.Open.L.Disabled = false |
11 | game.Workspace.Security.Front.Open.R.Disabled = false |
12 | game.Workspace.Security.Front.Open.L.Disabled = false |