Need to put leaderboard values into a gui

I have made a leaderboard for my game, but there are many different values, so I want to make it smaller and more sleek. To do this, I want to put a few values into different Gui, but I don’t know how to go about doing this. I think I know how I would put it into a Gui, but I have no clue how to not show it on the leaderboard. How would I do this?

1 Like

u could do

while wait() do
	local player = game.Players.LocalPlayer
	local find = player:WaitForChild("leaderstats")
	local stat = find:FindFirstChild("Your stat")
	
	script.Parent.Text = stat.Value
end

example:
image

the text changes to the leaderstat that you put

You can try this:

local LocalPlayer = game.Players.LocalPlayer
local Value = LocalPlayer.leaderstats.NumberValue
local TextLabel = script.Parent

TextLabel.Text = tostring(Value.Value) -- Sets the text to the value when the player join
Value.Changed:Connect(function()
    TextLabel.Text = tostring(Value.Value) -- Sets the text to the value when the value changes
end)
3 Likes

This works great! Unfortunately, it doesn’t get rid of where it puts the values on the leaderboard. Do you know how to do that?

Use this line of code: game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)

Should I put it in the same script?

If it is a LocalScript, then yes.

I don’t want to get rid of all the values, just one. There are other values that I want to keep showing. Here’s the script so far

local localPlayer = game.Players.LocalPlayer
local hours = localPlayer.leaderstats:WaitForChild("Hours")
local hoursAmount = script.Parent

game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList,false)

hoursAmount.Text = tostring(hours.Value)
hours.Changed:Connect(function()
	hoursAmount.Text = tostring(hours.Value)
end)

Then name the folder of the leaderstats you want to show, “leaderstats”.
And for the ones you don’t want to show, just name the folder something else other than leaderstats

1 Like

Parent the Hours to the Player or another Folder that isn’t named “leaderstats”

1 Like

Thank you! I’m marking this as the solution because this was the last step in fixing the problem. I will like all replies that helped me get to the solution.

1 Like