PointsService = game:GetService("PointsService") Stat = "KOs" --Change to the stats name Needed = 5 --Change to the amount needed to get the playerpoints. game.Players.PlayerAdded:connect(function(p) repeat wait() until p:FindFirstChild("leaderstats") ~= nil repeat wait() until p.leaderstats:findFirstChild(Stat) ~= nil p.leaderstats[Stat].Changed:connect(function(prop) if prop >= Needed then game:GetService("PointsService"):AwardPoints(p.userId,1) end end) end)
What I need to know how to do is make it so every 5 kills the player gets a player point, is there a thing such as 'i for 5 do ....' where i is kills and provides a player point for every 5 kills?
PointsService = game:GetService("PointsService") Stat = "KOs" --Change to the stats name Needed = 5 --Change to the amount needed to get the playerpoints. game.Players.PlayerAdded:connect(function(p) LeaderStat = p:WaitForChild("leaderstats"):WaitForChild(Stat) LeaderStat.Changed:connect(function() if LeaderStat.Value >= Needed and LeaderStat.Value % Needed == 0 then game:GetService("PointsService"):AwardPoints(p.userId,1) end end) end)
You'd probably want the script to check every time the board updates for a player, and then if KO's are equal to a multiple of five, add a player point.