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
 

Player Points (Keeps Looping after touch)

Previous Thread :: Next Thread 
BloxianBoy1234 is not online. BloxianBoy1234
Joined: 27 Oct 2013
Total Posts: 1006
10 Jul 2014 04:35 AM
Hi, my Player Points script for the invisible pad keeps looping to that player about 5-6 times within 1 player point each time. I don't want it looping, I want it so it gives the player 2 points. I have the script below and it might need to have a anti-loop or something to stop the looping, it just annoys me!

local Pts = script.Parent
Pts.Touched:connect(function(part)
local g = game.Players:GetPlayerFromCharacter(part.Parent)
if part:IsA("Part") and (g) then
pps = game:GetService("PointsService")
if pps:GetAwardablePoints() >= 1 then
pps:AwardPoints(g.userId, 1)
wait(25)
end
end
end)
Report Abuse
BloxianBoy1234 is not online. BloxianBoy1234
Joined: 27 Oct 2013
Total Posts: 1006
10 Jul 2014 05:12 AM
Anyone?
Report Abuse
Lo202 is not online. Lo202
Joined: 31 Jan 2013
Total Posts: 579
10 Jul 2014 05:17 AM
Add debounce.
Report Abuse
BloxianBoy1234 is not online. BloxianBoy1234
Joined: 27 Oct 2013
Total Posts: 1006
10 Jul 2014 05:44 AM
I don't know where to put a debounce, can anyone show me the debounce script?
Report Abuse
Lo202 is not online. Lo202
Joined: 31 Jan 2013
Total Posts: 579
10 Jul 2014 05:51 AM
http://wiki.roblox.com/index.php?title=Scripting_Book/Chapter_6
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
10 Jul 2014 07:27 AM
local DB = true

local Pts = script.Parent
Pts.Touched:connect(function(part)
local g = game.Players:GetPlayerFromCharacter(part.Parent)
if part:IsA("Part") and (g) and DB then
DB = false
pps = game:GetService("PointsService")
if pps:GetAwardablePoints() >= 1 then
pps:AwardPoints(g.userId, 1)
wait(25)
DB = true
end
end
end)
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