So to start I just put two questions in one to save space, Plus I'd have to wait 30 minutes.
So to start off I wanted to ask if anyone knows anything about custom leaderboards, Not leaderboard stats but just the board that displays the names, is their a way to customize it? If you could help me learn anything about this that would be great.
Second, Datastores, I wanted to know, How do we saves stuff to em? How do we unload stuff to em, and how exactly does the server keep track of like what data belongs to what player, or do I have to script that. I also wanted to know, is it possible to save datastore stuff in numbers like 012000 and so the first number, 012 is like a chair or something, and then the 000 after it is quantity, or do datastores not exactly work that way.
Thanks for any help you can offer!
First off, for custom leaderboards:
You can create your own GUI to replace the leaderboard, but not customizing the existing one. If you'd like to disable the default leaderboard, use this code in a localscript: (API:Class/StarterGui/SetCoreGuiEnabled)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
Second, for data store:
If you want to use a datastore, call the DataStoreService::GetDataStore method and use UpdateAsync to update a value. Example: (API:Class/GlobalDataStore/UpdateAsync)
local DataStore = game:GetService("DataStoreService"):GetDataStore("Points") game.Players.PlayerAdded:connect(function(player) local key = "user_" .. player.userId --we want to give 50 points to users each time they visit DataStore:UpdateAsync(key, function(oldValue) local newValue = oldValue or 0 --oldValue might be nil newValue = newValue + 50 return newValue end) end)
P.S: You cannot yield in UpdateAsync, so don't use functions like wait(), or any function classified as YieldingFunction in the ROBLOX Wiki
This is explained in much greater detail at the ROBLOX Wiki (Data Store)