Removing comma from a 4-digit number on the leaderboard

  1. What do you want to achieve? I want my leaderboard to show the number without a comma in it, because it is a year.

  2. What is the issue?
    image
    It has a comma in it.

I have looked many places for a fix but I can’t seem to find it, I know this is possible because I have seen a leaderboard without commas.
image

This is my code

local Players = game:GetService("Players")

local function leaderboardSetup(player)
	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "leaderstats"
	leaderstats.Parent = player

	local accountAge = player.AccountAge
	local accountCreation = os.time() - (accountAge * 24 * 60 * 60)
	local accountCreationYear = os.date("%Y", accountCreation)

	local joinYear = Instance.new("IntValue")
	joinYear.Name = "Joined"
	joinYear.Value = accountCreationYear
	joinYear.Parent = leaderstats
end

-- Connect the "leaderboardSetup()" function to the "PlayerAdded" event
Players.PlayerAdded:Connect(function(player)
	leaderboardSetup(player)
end)

Instead of making the joinYear a “IntValue”, make it a string value and place accountCreationYear in a tostring().


	local joinYear = Instance.new("StringValue")
	joinYear.Name = "Joined"
	joinYear.Value = tostring(accountCreationYear)
	joinYear.Parent = leaderstats

Thank you so much, that worked.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.