I've done this with leaderstats before and its easy that way.
I want to know how to do it without so its harder to exploit/change with exploits.
You should keep all the real values somewhere that the client cannot access them. I personally use ServerStorage. Then you can have a Changed event linked to those values and make the leaderboard display them. Here is an example:
game.Players.PlayerAdded:Connect(function(player) local stats = Instance.new("Folder") stats.Name = "leaderstats" stats.Parent = player local cash = Instance.new("IntValue") cash.Name = "Cash" cash.Parent = stats local playerFolder = Instance.new("Folder") playerFolder.Name = player.Name -- every time you need to access the players real money from a script you will need to find the folder with the players name in ServerStorage playerFolder.Parent = ServerStorage local serverCash = Instance.new("IntValue") serverCash.Name = "ServerCash" serverCash.Parent = playerFolder serverCash.Changed:Connect(function() -- whenever serverCash gets changed by you the leader board will now display that amount without it being vulnerable to attack cash.Value = serverCash.Value end) end)
Note: You will have to remember to :Destroy() the folder when the player leaves. else server storage could quickly be filled up with folders. Hope this helps and have a great day scripting!
I remember seeing something where you would have another two values and if the real values were different to the other two then it would change back. So basically say when a player earns 1 cash it updates the two different values and then the real values contain a script were if it notices a change it will update the real values.
Hope this helps.