I need Help with a script that awards 15 points every KO. I already have points in the server but I don't know how to award them. Please Help!
My Code:
PointsService = game:GetService("PointsService")
Stat = "KOs"
Needed = 1
game.Players.PlayerAdded:connect(function(p)
repeat wait() until p:FindFirstChild("leaderstats") ~= nil
print("Found \"leaderstats\" object!")
repeat wait() until p.leaderstats:findFirstChild(Stat) ~= nil
print("Found "..Stat.." object!")
p.leaderstats[Stat].Changed:connect(function(prop)
print("Value changed!")
if prop >= Needed then
game:GetService("PointsService"):AwardPoints(p.userId,15) --Change 1 to the amount of points to be awarded each time
end
end)
end)
