Hello!
I am currently working on a script that gives points starting from 6 AM to 8PM. Here's what I got so far:
amount = 2 --Amount of power we will give each time timedelay = 5 --Amount of Seconds in between each time the power is rewarded currencyname = "Power" --Name minutesAfterMidnight = 0 while true do minutesAfterMidnight = minutesAfterMidnight + .5 game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight) wait(0.1) if game.Lighting.ClockTime == 6.000 then --checks for 6AM while true do wait(timedelay) for i,v in pairs(game.Players:GetPlayers()) do if v:FindFirstChild("leaderstats") and v then v.leaderstats[currencyname].Value = v.leaderstats[currencyname].Value + amount end end end end end
For some reason the time stops at 6 and gives me a few points. Am I looping something incorrectly?