Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My script won't add one to an IntValue, how can I fix it?

Asked by 4 years ago

I am trying to make a day/night script but also utilize values to change the day from Sunday, to Monday, and so on, but for some reason, the value won't change and I'm not receiving any errors.

01local lighting = game:GetService("Lighting")
02local replicatedStorage = game:GetService("ReplicatedStorage")
03local event = replicatedStorage:findFirstChild("Time")
04 
05while wait(.9) do
06 local hours = math.floor(lighting:GetMinutesAfterMidnight() / 60)
07 local suffix = "AM"
08 local minutes = lighting:GetMinutesAfterMidnight() - (hours * 60)
09 if hours > 11 then
10  hours = hours - 12
11  suffix = "PM"
12 end
13 
14 if hours == 0 then
15  hours = 12
View all 32 lines...

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

At line 29 the Start value and End value are the same (which is the reason it wouldn't work) make the End Value Higher (maybe 2 or 10 idk)

1for i = 1,10 do -- End value should be higher than Start
2wait(.1) don't forget to include a wait
Ad

Answer this question