How to put a string/letter after a number value in the leaderstats?

Right now I am using a string and it works, the problem is that 10 is worth less than 2, 20 is worth less than 3, and so on. How can I fix this problem?
10% should be at the top not 5%.
Rage
If I was not using a string everything would work fine but then I can’t use a % after. Or is it possible by converting a number to a string or something? Maybe tostring()

This is how it looks like in the script (not the whole script)

progress.Value = math.round(yAxis / 5375 * 100).."%"

Any questions, feel free to ask, thank you!
/Xsodar

Send your leaderstats script (The process of creating a folder and values)

I don’t think this would work with %'s after it. A possible solution would be to make the name of the leaderstat Progress (%) and having it be a IntValue.

Another solution would be making a custom or modified leaderboard then removing (gsubbing) the % and displaying the highest on top (so it still has the % but it is in order).

game.Players.PlayerAdded:Connect(function(player)
	local ls = Instance.new("Folder")
	ls.Name = "leaderstats"
	ls.Parent = player
	
	local progress = Instance.new("StringValue")
	progress.Name = "Progress"
	progress.Parent = ls
	progress.Value = "0%"
	
	local timer = Instance.new("IntValue")
	timer.Name = "Timer"
	timer.Parent = ls
	timer.Value = "0"
end)

Yeah, I might do that, if nothing else works :slight_smile:

You can’t sort the order of the roblox leaderstats. You may wanna make a new leaderboard.

Okay, might do that then, thanks : )

Sorting is based on the first generated value. My code works and will change position when percentage changes

game.Players.PlayerAdded:Connect(function(plr)
	local folder = Instance.new("Folder", plr)
	folder.Name = "leaderstats"
	local Progress = Instance.new("StringValue", folder)
	Progress.Name = "Progress"
	Progress.Value = math.random(0, 100).."%"
	local money = Instance.new("NumberValue", folder)
	money.Name = "Money"
	money.Value = math.random(0, 100)
	while wait(3) and Progress do
		Progress.Value = math.random(0, 100).."%"
	end
end)

Is your code sorting by which value is greater? Or just change position when the value is changed. Example, 3% and 10%, 10% at top but when %3 is changed it moves to top.

It just works if the value is changed. But what he want is sort the value by the which one is greater. Not randomly.

I randomly change the values ​​and it sorts it by the largest
try use it: progress.Value = 0.."%" and change the values ​​like this number.."%"

Ekran Alıntısı3

It didn’t make it in time as I did a very quick shift to film the video.

I’ll try that out and see if that will work for me, thank you!

What you doing is generating the value and it placing in the first place not if value is greater then it. I cant see any comparing operator over there. But it is work. And if we keep talking about this, thread will be out of the topic.

Are you kidding now? I don’t need to compare and sort anything at all, as the PlayerList does it instead of me.

Okay it works. Sorry. kahrakhters