So i want to save everyones money so i can so who has the most money? But that needs to be in a folder? Does anyone know method to save it and i can view it in edit? Without datastore if not i will leave this solved
What you have to do is loop through all of the values inside the folder, and save the value of each one in a table.
local function CompileSaveData(Plr) local SaveData = {} for _,Data in pairs(Plr.FolderHere:GetChildren()) do SaveData[Data.Name] = Data.Value end return SaveData end
If you gave that example function the player, it would return a dictionary with every value name as their keys, and their values as the values' value (woah thats a lot of values)
Then, you would datastore that table (similarly to how I explain here). When the player joins, you can load this data and re-create all the values with something like this:
local function CreateValues(Plr,SaveData) for Name,Value in pairs(SaveData) do Plr.FolderName:WaitForChild(Name).Value = Value end end
When you give this function a player along with the loaded data, it will go through the data and re-enter every saved value into the values in their folder. You will have to change the FolderName to the appropriate name in both the examples (such as 'leaderstats' if the values are part of the leaderboard).
Hope this helps!