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

How do I make a currency increase script during a certain time of day?

Asked by
4d0z 4
5 years ago

Hi!

I've been working on this script for several days now and it's driving me crazy! This is what I have so far:

currencyname = "Power"


if game.Lighting.ClockTime == 6.000 then -- Start giving points at 6 AM
    wait(1)
    for i, v in pairs(game.Players:GetPlayers()) do
        if v:FindFirstChild("leaderstats") then
            v.leaderstats[currencyname].Value = v.leaderstats[currencyname].Value + 5
        end
    end
if game.Lighting.ClockTime == 18.400 then
    wait(1)
    for i, v in pairs(game.Players:GetPlayers()) do
        if v:FindFirstChild("leaderstats") then
            v.leaderstats[currencyname].Value = v.leaderstats[currencyname].Value + 0
        end
    end
end
    end

Thanks!

0
Is there a loop? the8bitdude11 358 — 5y
0
also, is there any errors in the output? the8bitdude11 358 — 5y
0
No errors at all. It seems like the game just ignores the script 4d0z 4 — 5y
0
there is a for loop 4d0z 4 — 5y

Answer this question