Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Player Points Help (Script) ?

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 `

2 comments

0

I'm not sure, but the player might need to be in the server to get the point(s).

0

Done game:GetService("PointsService"):AwardPoints(17820096,1)

1 answer

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

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

This discussion is preserved as it was. New answers, comments, and votes are closed.