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

Is this the right code for Game leaderboards?

Please note I am referring to the leaderboards page that can be seen as games. It has a "Players" and "Clans" section. I have this code in PlayerAdded and I see the message appear saying I got the points, but when I check my place it says "No Players Found"...do I need to save this?


 local PointsService = game:GetService("PointsService")
            local universeBalance = PointsService:GetGamePointBalance(player.userId)
                    PointsService:AwardPoints(player.userId, 1)

1 comment

0

Heya,I'm unable to open studio right now.As soon as I can I will help you with this issue.

1 answer

If you are referring to the leaderboard that scripters make to show on the player list then you would need to use IntValues. You could also make a section that shows the "Points" awarded to the player. It could look something like this.


 game.Players.PlayerAdded:connect(function(plr)

 local folder = Instance.new("Folder") -- Puts the leaderstats in a secure place so that it is harder to hack
folder.Name = "leaderstats" -- Has to be called this for the script to know you are trying to make a leaderboard
folder.Parent = plr


local KO = Instance.new("IntValue") --Creates a value to hold what you want
KO.Name = "Kills" -- Names the value
KO.Parent = folder --Puts the parent in the folder
 
local point = Instance.new("IntValue")
point.Name = "Points"
point.Parent = folder

--[[If you want to update the "Points" then you can do]]
point.Changed:connect(function()
--Put what you want in here to show
end)
end)

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