|
| 14 Sep 2014 10:29 PM |
So I was working on a script this afternoon that will turn on a streetlight and a Billboard GUI when it is a certain time:
print("Running") wait(3) t=game.Workspace.Lighting sp=script.Parent.Glare
while true do wait(0.01) if t.TimeOfDay <= "17:30:00" then sp.PointLight.Enabled=true sp.BillboardGui.Enabled=true end if t.TimeOfDay <= "6:30:00" then sp.PointLight.Enabled=false sp.BillboardBui.Enabled=false end print("Still Working") end
When I tested it, it didn't work. Please help? |
|
|
| Report Abuse |
|
|
| |
|
Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
| |
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 14 Sep 2014 10:46 PM |
tonumber wouldn't be a smart idea in this scenario when there is a method in Lighting called
:GetMinutesAfterMidnight()
And
:SetMinutesAfterMidnight() |
|
|
| Report Abuse |
|
|
|
| 14 Sep 2014 10:53 PM |
I don't really understand.
To be honest, I used the wiki. |
|
|
| Report Abuse |
|
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 14 Sep 2014 10:56 PM |
17:30:00 is 17 hours and 30 minutes
17 hours * 60 = 1020 Minutes 1020 + 30 = 1050 minutes
if t:GetMinutesAfterMidnight() <= 1050 then -- Understand it? |
|
|
| Report Abuse |
|
|
|
| 14 Sep 2014 10:59 PM |
| Oh, thanks! I appreciate your help :D. |
|
|
| Report Abuse |
|
|
| |
|