|
| 10 Jun 2014 04:16 AM |
Why is this script rewarding 5 PP before 10 minutes is up?
local PointsService = Game:GetService("PointsService") game.Players.PlayerAdded:connect(function(player) while true do wait(600) -- Change the 60 to change how long it takes to get the points local pointsToAward = PointsService:GetAwardablePoints() if ( pointsToAward > 0) then pcall(function() PointsService:AwardPoints(player.userId, 5) -- Change the 10 to how many points you want to be awarded end) end end end) PointsService.PointsAwarded:connect(function(userId, userBalanceinUni, userBalance) end)
|
|
|
| Report Abuse |
|
|
|
| 10 Jun 2014 06:49 AM |
My best guess is that it doesn't, and there's another script in the place somewhere that awards the points.
Other than that, I could imagine that wait() doesn't like such long wait times and caps out at less than 600 seconds. Perhaps you could try using several wait calls instead of one? |
|
|
| Report Abuse |
|
|
eletrowiz
|
  |
| Joined: 08 Dec 2008 |
| Total Posts: 12438 |
|
|
| 10 Jun 2014 06:54 AM |
Or you could use tick() and give it out every five minutes.
oldtime=tick() repeat wait(20) until tick()-oldtime>600
It may not be exactly 5 minutes though, sometimes that wait function seems a bit sketchy. |
|
|
| Report Abuse |
|
|
|
| 10 Jun 2014 01:28 PM |
| Hmmm, seems like the script is giving PP when a player is NOT in the game o.e |
|
|
| Report Abuse |
|
|