PointsService = game:GetService("PointsService") Stat = "KOs" game.Players.PlayerAdded:connect(function(p) repeat wait() until p:FindFirstChild("leaderstats") ~= nil repeat wait() until p.leaderstats:FindFirstChild(Stat) ~= nil repeat wait() until p.leaderstats:FindFirstChild("NextPP") ~= nil p.leaderstats[Stat].Changed:connect(function(prop) print("Value changed!") need = p.leaderstats:FindFirstChild("NextPP").Value print("Found Need") if prop >= need then game:GetService("PointsService"):AwardPoints(p.userId,1) need = need + 5 -- this is where it's messing up. print("Awarded points and need has went up") end end) end)
For some reason at line 13, need doesn't go up by 5. Everything works but that. (All of the prints and awarding player points)
Did I set it up wrong?
PointsService = game:GetService("PointsService") Stat = "KOs" game.Players.PlayerAdded:connect(function(p) repeat wait() until p:FindFirstChild("leaderstats") ~= nil repeat wait() until p.leaderstats:FindFirstChild(Stat) ~= nil repeat wait() until p.leaderstats:FindFirstChild("NextPP") ~= nil p.leaderstats[Stat].Changed:connect(function(prop) print("Value changed!") need = p.leaderstats:FindFirstChild("NextPP") print("Found Need") if prop >= need then game:GetService("PointsService"):AwardPoints(p.userId,1) for i = 1,1 do need.Value = need.Value + 5 --This should make need +5. end print("Awarded points and need has went up") end end) end)
Doing so should +5 need.