generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Uhhhh.

Previous Thread :: Next Thread 
speedydude900 is not online. speedydude900
Joined: 02 Feb 2010
Total Posts: 788
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
VolcanoINC is not online. VolcanoINC
Joined: 19 Sep 2008
Total Posts: 1395
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 is not online. 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
speedydude900 is not online. speedydude900
Joined: 02 Feb 2010
Total Posts: 788
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image