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(60) else print"not humanoid" end end end end press = false end)
The above script works just like it has no debounce (even though I'm pretty sure I used it correctly) and gives the player 5 times the certain amount of points rather than giving it just once when the player touches it once.
I'm assuming you wanted a 60 second cool-off time so nobody else can touch it during that period, so here you go. I also fixed up the spacing.
local press = false local pointgiver = script.Parent pointgiver.Touched:connect(function(pointgiver) if not press then local g = game.Players:GetPlayerFromCharacter(pointgiver.Parent) if pointgiver:IsA("Part") and g then press = true 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(60) press = false else print("not humanoid") end end end end end)