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

Player Points Help (Script) ?

Asked by 10 years ago

I have this Script At The moment ..

PointsService = game:GetService("PointsService")
Stat = "Coins" --Change to the stats name
Needed = 500 --Change to the amount needed to get the playerpoints.
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,1)
                end
        end)
end)

Ran with this

local service = game:GetService("PointsService") 

game.Players.PlayerAdded:connect(function(player) 
player:WaitForDataReady() 
service:AwardPoints(96673074, service:GetAwardablePoints()) 
end) 

I Want To Add Upon these scripts so for every point in my game earnt i also get one `

0
I'm not sure, but the player might need to be in the server to get the point(s). Thewsomeguy 448 — 10y
0
Done game:GetService("PointsService"):AwardPoints(17820096,1) jblade73 18 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

service:AwardPoints(96673074, service:GetAwardablePoints())

I hope you realize that will award userId 96673074 every single point in your game.

Ad

Answer this question