|
| 23 Sep 2012 08:01 PM |
Workspace.TimeOfDay:2: ',' expected near ':'
This is the error that appears whenever I try to modify the existing script.
Here's the actual script.
while true do for i = 00:00:00, 23:40:00, +00:00:04, do F = game:service("Lighting") F:SetMinutesAfterMidnight(F:GetMinutesAfterMidnight(i)) wait(2.5) print(i) end end
What would be wrong here? This script looks mostly correct to me. Can the "for" loop be put in here with the Set and GetMinutesAfterMidnight?
|
|
|
| Report Abuse |
|
|
|
| 23 Sep 2012 08:08 PM |
'For' loops can only have numbers;
for i = 1, 4 do
is correct, but
for i = 00:01, 24:00 do
is incorrect.
http://wiki.roblox.com/index.php/In-Depth_Scripting_Guide#The_.27for.27_Statement |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 23 Sep 2012 08:12 PM |
@crazybanana
As of a fact you are correct, that's not his problem. His problem is the TimeOfDay value takes a string value. So when you use a for loop you're trying to compare a number value from a string value. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 23 Sep 2012 08:14 PM |
You can always
String = "12:42:23" Hr = string.sub(String, 1, 2) Min = string.sub(String, 3, 4) Sec = string.sub(String, 5, 6)
i think
he can always do
while true and wait() do ..GetMinutesAfterMidnight + 1? end |
|
|
| Report Abuse |
|
|
|
| 23 Sep 2012 08:16 PM |
> 'For' loops can only have numbers;
Not true.
¤ ¤ † K M X D † ¤ ¤ |
|
|
| Report Abuse |
|
|
|
| 23 Sep 2012 08:16 PM |
| So, how would you write the script? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 23 Sep 2012 08:17 PM |
while true and wait() do ..GetMinutesAfterMidnight + 1? end
|
|
|
| Report Abuse |
|
|