Havenvw
|
  |
| Joined: 25 Sep 2013 |
| Total Posts: 4 |
|
|
| 24 Aug 2017 10:25 PM |
Hello I am a beginner scripter and I want to make a door that only opens at certain times of the day, so I wrote this code:
while true do if game.Lighting.TimeOfDay == "14:00:00" then print ("closed") end wait (1) end
I thought this would work but it didn't. Could someone please explain to me where I went wrong. |
|
|
| Report Abuse |
|
|
Havenvw
|
  |
| Joined: 25 Sep 2013 |
| Total Posts: 4 |
|
| |
|
Luminak
|
  |
| Joined: 27 May 2012 |
| Total Posts: 2809 |
|
|
| 24 Aug 2017 10:32 PM |
well its not gonna close by printing close
|
|
|
| Report Abuse |
|
|
Havenvw
|
  |
| Joined: 25 Sep 2013 |
| Total Posts: 4 |
|
|
| 24 Aug 2017 10:33 PM |
| Yeah I know I just wanted it to Print "Close" so I know it would work. |
|
|
| Report Abuse |
|
|
Luminak
|
  |
| Joined: 27 May 2012 |
| Total Posts: 2809 |
|
|
| 24 Aug 2017 10:40 PM |
1. you don't have to do a while true do loop, you can just do game.Lighting.TimeOfDay.Changed:connect(function() for less lag
2.14:00:00 is not a string value, so you must put ("14:00:00")
|
|
|
| Report Abuse |
|
|
Havenvw
|
  |
| Joined: 25 Sep 2013 |
| Total Posts: 4 |
|
| |
|