Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Player Point Issue - Why is this breaking?

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.

2 comments

0

Are there any error messages?

0

There are no error messages, I've even tested this in a real server with real players.

1 answer

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

1 comment

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"

This discussion is preserved as it was. New answers, comments, and votes are closed.