I am making a Script when a Player touches a part, and it gives them 1 Player Point, but it gives them 2-4 Player Points when they touch it, not 1. Does anyone know to fix it?
local Model = script.Parent print 'PlayerPart Script running!' --PointsPart-- local egg = script.Parent local ModelCopy = Model:Clone() debounce = false egg.Touched:connect(function(part) local g = game.Players:GetPlayerFromCharacter(part.Parent) if debounce then return end if part:IsA("Part") and (g) then --So, basically, when a player touches this part, they get 1 player point. pps = game:GetService("PointsService") if pps:GetAwardablePoints() >= 1 then --change if possible pps:AwardPoints(g.userId, 1) debounce = true wait(5) debounce = false end egg:remove() wait(100) ModelCopy.Parent = game.Workspace end end) --Script made by me-- --THIS REQUIRES A POINTS AVALIBLE GUI-- print ('stopthecakehate made the player points part script')
Line 12.
local Model = script.Parent print 'PlayerPart Script running!' --PointsPart-- local egg = script.Parent local ModelCopy = Model:Clone() debounce = false egg.Touched:connect(function(part) local g = game.Players:GetPlayerFromCharacter(part.Parent) if debounce then return end debounce = true --set to true before you continue with the rest if part:IsA("Part") and (g) then --So, basically, when a player touches this part, they get 1 player point. pps = game:GetService("PointsService") if pps:GetAwardablePoints() >= 1 then --change if possible pps:AwardPoints(g.userId, 1) wait(5) debounce = false end egg:remove() wait(100) ModelCopy.Parent = game.Workspace end end) --Script made by me-- --THIS REQUIRES A POINTS AVALIBLE GUI--