HI! I'm making a game that contains a leaderboard with cash, levels,exp, and etc. All those stats take up the leaderboard and can make it take up the screen if there is a great number of people. My question is that is it possible to hide specific stats on the leaderboard instead of hiding the whole board. Example, I want to hide the exp and money in the leaderboard while keeping the levels stats visible. if you need me to explain more in dept, let me know. Thanks for your assistance.
I was planning on just commenting on the other two answers to help you but it’s a little hard to explain with comments, so I’m going to explain what both those guys are trying to say by an answer.
GingeyLol is trying to say you should put, or parent, the value(s) in leaderstats into the player itself. It’d be something like :
game.Players.LocalPlayer.leaderstats.Points
into
game.Players.LocalPlayer.Points
See the difference? The Points value is not in the leaderstats anymore, but in the player itself.
Now, what CrastificeDude612 is trying to say. He’s saying you should make a folder and name it “hidden”. Then put it in leaderstats to store unused values. Apparently you don’t know how to make and put a folder into leaderstats so here’s an example :
local hidden = Instance.new(‘Folder’) hidden.Name = ‘hidden’ hidden.Parent = game.Players.LocalPlayer.leaderstats
This script creates a folder, names it “hidden”, then parents it to leaderstats. Also if you’re using a server (regular) script, you’ll have to change LocalPlayer into a specific player (Ex : A player’s username), as LocalPlayer doesn’t work in server scripts.
Oh, and one more thing. If you’re going to hide a value in one player, you must do it in ALL players, as doing it in one only messes up the leaderstats. You can use a for loop to get all the players and hide the values.
Hope I explained everything clearly. If this answer helped and you want to accept it, please at least upvote the other two answers as they are good solutions to answer your problem. All I did was explain them. If you have any questions, comment it in my answer and I’ll get back to you.
Yes. Don't put the object/value directly under the object named "Leaderstats" but instead put the object/value directly as a child of the player.
Put another folder in the Leaderstats and call that "hidden". Values that go in that folder called 'hidden' will be hidden while others will be shown. That is all I can explain to you.
For @Denny9876 Here is The Script.
function onPlayerEnter(player) game.Players.LocalPlayer.Points local board = Instance.new("BoolValue", player) board.Name = "leaderstats" local gold = Instance.new("IntValue", board) gold.Name = "Test1" gold.Value = 1000 local gold = Instance.new("IntValue", board) gold.Name = "Test2" gold.Value = 1 end game.Players.ChildAdded:connect(onPlayerEnter)
What needs to change or needs to be added?