Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I award points when somebody gets a KO?

Asked by 10 years ago

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)

1 answer

Log in to vote
0
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
10 years ago

I am sorry, but this is not a request site. Please try to code it yourself, and if it does not work, we will help you fix it.

Ad

Answer this question