How can I hide my leaderstats?

Hello, I made leaderstats for my game. I want to hide them so the game looks cleaner. Any help?

Script:

function onPlayerEntered(newPlayer)
	local stats = Instance.new("IntValue")
	stats.Name = "leaderstats"


	local secs = Instance.new("IntValue")
	secs.Name = "LEVEL"
	secs.Value = 0

	secs.Parent = stats

	stats.Parent = newPlayer

	while true  do
		wait (60)
		secs.Value = secs.Value + 1
	end
end

game.Players.ChildAdded:Connect(onPlayerEntered)

thanks!

1 Like

If you don’t want the game to display the leaderboard stuff on the player list, simply rename leaderstats to something else and change every reference to it. The stats you added will exist, but since it’s not exactly contained in a thing called leaderstats, it wont display them

1 Like

If you want, you can also use :SetCoreGuiEnabled to hide the player list of the player screen :slight_smile:

2 Likes

error
I’m having this type of error in the output, is anything wrong? I renamed leaderstats to stats and changed all of the scripts and it does this… I’m quite confused

Could you show you me the script that is erroring. Also, I recommend you use PlayerAdded instead of ChildAdded for that script you’ve sent in your post

local billGui = game.ReplicatedStorage.LevelGui
local text = billGui.Level
local event = game.ReplicatedStorage.CashChanged

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		char.Humanoid.NameDisplayDistance = 0
		local newOverhead = billGui:Clone()
		newOverhead.Parent = char.Head
		local newText = newOverhead.Level
		newText.Text = "LEVEL: "..plr.Stats.LEVEL.Value

		event.OnServerEvent:Connect(function(plr, character)
			character:WaitForChild("Head").LevelGui.Level.Text = "LEVEL: "..plr.Stats.LEVEL.Value
			
			plr.Stats.LEVEL.Value:Connect(function()
				billGui.Level.Text = "LEVEL : "..plr.Stats.LEVEL.Value
			end)
		end)
	end)
end)

It works fine, It just creates an error in the output and I don’t know why.

I think since I changed it to stats its having troubles connecting it to a function since its not leaderstats anymore.

You’re trying to use Connect on the value of the level, remove the .Value and replace it with Changed if you’re trying to listen for when the value changes

plr.Stats.LEVEL.Changed:Connect(function()

also you can do this
humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None

I think that was the script before I changed it and I accidentally removed it when trying to change the script so it will be okay. I didn’t notice at all, Thank you a lot!

1 Like

Thank u too, Does that really matter tho? They’re both quite the same.