Invisible leaderstats

Is it possible to make invisible leaderstats (so players cant see stats inside it), but for example when player click GUI Button, it makes it visible only for that player?

You could make a table in a server script and then once the player clicks the guibutton it sets the leaderstat locally.

Server:

local stats = {
[game.Players.Floyddo] = 100,
[game.Players.Skiilguard] = 5,
}

game.Replicatedstorage.Remote.OnServerEvent:Connect(function(plr)
  game.Replicatedstorage.Remote:FireClient(plr, stats)
end)

We make a table with the player corresponding to the value of their stat, modify this by doing stats[plr] = [yourvaluehere]. Then once the remote is fired the server sends the stats back.

Local:

script.Parent.MouseButton1Down:Connect(function()
    game.Replicatedstorage.Remote:FireServer()
end)
game.Replicatedstorage.Remote.OnClientEvent:Connect(function(stats)
  for i,v in pairs(stats) do
    i.leaderstats.Stat.Value = v
  end
end)

Once the button is clicked, the script is a child of the button, we fire the remote. Once we get the stats back, we set the leaderstats per player. Because this is a localscript only the player that clicked it can see it.

We put the data on the server, so it can be saved, not be seen by an exploiter (without clicking the button) and because you can modify it.

If you actually want to make this make sure to add a check because with this script an exploiter can fire it and get the stats.

1 Like

Would this work with kill count? I am creating this for administrative purposes, so like when someone kills someone, admin clicks button and see on leaderboard who has how many kills

Yeah, once someone kills someone else, just increase it. Make sure to secure it by checking if the player that sent it is an admin (on the server).

1 Like

Ok, thank you so much

Hdhdhdbdhdhdhdh

I just realized, leaderboard is visible for everyone, just value is set to 0 for everyone. I dont want it to look like this

You can set it to non visible, but you wont be able to see the players either.
Here’s a link:

1 Like

You can also just remove the leaderstat locally, not sure if it’ll work but it might!

2 Likes

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