Default leaderboard isn't sorting players with higher scores?

Are there any reasons why the leaderboard would stop sorting players with higher scores? I just noticed this during a testing. I remember it fluctuating when I would get higher xp or a higher level but now it just sits no matter how much your score is.
– RESOLVED

I’m not able to reproduce

image

Can you send your leaderstats script? Maybe I would try with that one
Note: Your problem is probably about your leaderstats value types

Here’s mine:

game.Players.PlayerAdded:Connect(function(Player)
	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "leaderstats"
	leaderstats.Parent = Player

	local HillPoints = Instance.new("IntValue")
	HillPoints.Name = "Luck"
	HillPoints.Value = 0
	HillPoints.Parent = leaderstats

	local InHill = Instance.new("IntValue")
	InHill.Name = "Power"
	InHill.Value = 0
	InHill.Parent = leaderstats
	
	local InHill = Instance.new("IntValue")
	InHill.Name = "Level"
	InHill.Value = 0
	InHill.Parent = leaderstats
	
	local InHill = Instance.new("IntValue")
	InHill.Name = "XP"
	InHill.Value = 0
	InHill.Parent = leaderstats
end)
2 Likes

Give me a second but I never knew you could use the same name to create leaderstat values. Cool. I think it’s my leaderstats too for some reason but i don’t know why I’ll have to post and carefully look.

1 Like

local Players = game.Players

local function skilltreeSetup(player)

local leaderstats = Instance.new("Folder",player)
leaderstats.Name = "leaderstats"

local skill_Luck = Instance.new("IntValue",leaderstats)
skill_Luck.Name = "Luck"
skill_Luck.Value = 0

local skill_Power = Instance.new("IntValue",leaderstats)
skill_Power.Name = "Power"
skill_Power.Value = 0

local combatLevel = Instance.new("IntValue",leaderstats)
combatLevel.Name = "Level"
combatLevel.Value = 1

local playerXP = Instance.new("IntValue",leaderstats)
playerXP.Name = "XP"
playerXP.Value = 0

--PRIVATE VAR
local privateVars = Instance.new("Folder",player)
privateVars.Name = "privateVars"


local xpRequired = Instance.new("IntValue",privateVars)
xpRequired.Name = "Xp Required"
xpRequired.Value = 500

local levelsRequired = Instance.new("IntValue",privateVars)
levelsRequired.Name = "Levels Required"
levelsRequired.Value = 0

local pointsCollected = Instance.new("IntValue",privateVars)
pointsCollected.Name = "Essence Collected"
pointsCollected.Value = 0

local essPayOut = Instance.new("IntValue",privateVars)
essPayOut.Name = "Ess PayOut"
essPayOut.Value = 10

local extractionAttempts = Instance.new("IntValue",privateVars)
extractionAttempts.Name = "Extraction Attempts"
extractionAttempts.Value = 0

local levelMilestone = Instance.new("IntValue",privateVars)
levelMilestone.Name = "Level Milestone"
levelMilestone.Value = 50

local hasRareTool = Instance.new("BoolValue",privateVars)
hasRareTool.Name = "Is Using Extractor"
hasRareTool.Value = false

end

Players.PlayerAdded:Connect(skilltreeSetup)

During local testing inside Studio it fluctuates but its still broken because once test player can have 500 xp and as soon as the other test player gets any xp they are placed above the player with 500. I wonder what broke it.

I used your same script but still same it’s works for me. If you really want it to work, look for custom leaderboards something like this

1 Like

hmm could it be that I’m connecting the player event to other functions in other scripts? its bogging my mind but I will look into that thanks

also, does it matter where you adjust a leaderboard stat? say i submit a request from the client that sends back the stat to adjust from the server. That should work server wide and not locally right? Even if i initiate from the server to the client. It should still count toward the stat right?

Also, may i ask what method you did to adjust the leaderstat? I’m just getting my head around local and server and that’s what this project is for knowing how to do things locally and how do communicate with server so if i ever make a finished game i have a proper way of doing things and it isn’t so vulnerable to fault.

Only the first column of values is used when sorting players, if you want the players to be sorted by ‘Level’ (for example) then instance and parent that stat to the ‘leaderstats’ folder first.

1 Like

sorting depends on the first stat (Luck)
So create XP values first then create other values.

local Players = game.Players

local function skilltreeSetup(player)

local leaderstats = Instance.new("Folder",player)
leaderstats.Name = "leaderstats"

local playerXP = Instance.new("IntValue",leaderstats)
playerXP.Name = "XP"
playerXP.Value = 0

local skill_Luck = Instance.new("IntValue",leaderstats)
skill_Luck.Name = "Luck"
skill_Luck.Value = 0

local skill_Power = Instance.new("IntValue",leaderstats)
skill_Power.Name = "Power"
skill_Power.Value = 0

local combatLevel = Instance.new("IntValue",leaderstats)
combatLevel.Name = "Level"
combatLevel.Value = 1

--PRIVATE VAR
local privateVars = Instance.new("Folder",player)
privateVars.Name = "privateVars"


local xpRequired = Instance.new("IntValue",privateVars)
xpRequired.Name = "Xp Required"
xpRequired.Value = 500

local levelsRequired = Instance.new("IntValue",privateVars)
levelsRequired.Name = "Levels Required"
levelsRequired.Value = 0

local pointsCollected = Instance.new("IntValue",privateVars)
pointsCollected.Name = "Essence Collected"
pointsCollected.Value = 0

local essPayOut = Instance.new("IntValue",privateVars)
essPayOut.Name = "Ess PayOut"
essPayOut.Value = 10

local extractionAttempts = Instance.new("IntValue",privateVars)
extractionAttempts.Name = "Extraction Attempts"
extractionAttempts.Value = 0

local levelMilestone = Instance.new("IntValue",privateVars)
levelMilestone.Name = "Level Milestone"
levelMilestone.Value = 50

local hasRareTool = Instance.new("BoolValue",privateVars)
hasRareTool.Name = "Is Using Extractor"
hasRareTool.Value = false

end

Players.PlayerAdded:Connect(skilltreeSetup)
1 Like

Thanks for that insight :slight_smile: That little bit of information just saved me a headache. I never knew the leading stat is what the leaderboard goes by. Im sure i overlooked that TIP somewhere in the docs lol