I have a Motorcross game (Fairly popular) and every time someone crosses the finish, it awards 7 points! Not 1! At the rate it's going, it'll run out in 40 races!
01 | local part = script.Parent |
02 | part.Touched:connect( function (part) |
03 | local g = game.Players:GetPlayerFromCharacter(part.Parent) |
04 | if part:IsA( "Part" ) and (g) then |
05 | pps = game:GetService( "PointsService" ) |
06 | if pps:GetAwardablePoints() > = 1 then |
07 | pps:AwardPoints(g.userId, 1 ) |
08 | end |
09 | script.Parent:remove() |
10 | end |
11 | end ) |
You should add a debounce
01 | debounce = true |
02 | local part = script.Parent |
03 | part.Touched:connect( function (part) |
04 | local g = game.Players:GetPlayerFromCharacter(part.Parent) |
05 | if debounce = = true then |
06 | debounce = false |
07 | if part:IsA( "Part" ) and (g) then |
08 | pps = game:GetService( "PointsService" ) |
09 | if pps:GetAwardablePoints() > = 1 then |
10 | pps:AwardPoints(g.userId, 1 ) |
11 | end |
12 | script.Parent:remove() |
13 | end |
14 | end ) |
If it doesn't work, tell me the output in a comment