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

Will this work properly?

Asked by 9 years ago

What this code should do, is award every player in the server 1 PP every 10 minutes:

local PPS = game:GetService("PointsService")
while PPS:GetAwardablePoints() >= game.Players.NumPlayers do
    for i,v in pairs (game.Players:GetChildren()) do
        PPS:AwardPoints(1,v.userId)
    end
    wait(10*60)
end

1 answer

Log in to vote
0
Answered by 9 years ago
while wait(60*10) do
local PPS = game:GetService("PointsService")
if PPS:GetAwardablePoints() >= game.Players.NumPlayers then
for i,v in pairs(game.Players:GetChildren()) do
PPS:AwardPoints(1,v.userId)
end
end
end

It does it every 600 seconds, this works much better as time in my opinion should be used for the while wait() do key and then award after that long. However, if you wanted you could create a countdown timer that is a bit more difficult however it allows for some room of functions under it. But for this way your using I doubt you need that.

0
I put this script in Workspace, so I think it should be fine right?? fahmisack123 385 — 9y
0
Yes, it should work in workspace, make sure that it's a script not a local script. Also please give me a reputation! micke3212 35 — 9y
Ad

Answer this question