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

Player Point Issue - Why is this breaking?

Asked by 9 years ago
local press = false
local pointgiver = script.Parent
pointgiver.Touched:connect(function(pointgiver)
if not press then
press = true
local g = game.Players:GetPlayerFromCharacter(pointgiver.Parent)
if pointgiver:IsA("Part") and (g) then
pps = game:GetService("PointsService")
if pps:GetAwardablePoints() >= 1 then
local plr = pointgiver.Parent:findFirstChild("Humanoid")
if plr.Health == 100 then
pps:AwardPoints(g.userId, 1)
wait(10)
else
print"not humanoid"
end 
end
enabled = false
end
end
end)

The problem with this script is that it doesn't award another point after another 10 seconds, it only awards the point when you touch it the first time, and no points are awarder after touching it the second, third and so on time...

I can't think of a way to fix this... I'm guessing the problem is located in the place I used "else" and probably the place I used the last "enabled = false" debounce.

0
Are there any error messages? GoldenPhysics 474 — 9y
0
There are no error messages, I've even tested this in a real server with real players. excellentAnarchy 50 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

Player points are really glitchy, I've had this problem multiple times with my studio. I just had to make a new place because no player points would work at my other

0
nvm, I found the problem, just look at my debounce... It do3snt work because at first its "press" and at line 18 I type "enabled" excellentAnarchy 50 — 9y
Ad

Answer this question