So basically I was making a datastore system for my game, but right afterwards, me and my friend decided we wanted a leaderboard, and for that, I need OrderedDataStores. I’ve tried swapping out GetDataStore with GetOrderedDataStore, changing the name of the datastore, but nothing is helping. I deleted all my mistake code so that someone can help me. I’m so confused on how I can do this., since I’ve never used OrderedDataStores and youtube isn’t helping me today. Here’s my code:
local players = game:GetService("Players")
local dataStoreService = game:GetService("DataStoreService")
local playerStatsDataStore = dataStoreService:GetDataStore("PlayerStats")
local module = {}
-- There's more code here, though I wanted to make this simpler --
-- If you need the code here, just ask --
module.GetData = function()
-- I want to get all the data in the datastore in order so I can return it --
end
return module
Also, the error I got for every single attempt at fixing my code was:
18:19:07.270 DataStoreService: ValueNotAllowed: Array is not allowed in data stores. API: SetAsync, Data Store: PlayerStats - Studio
18:19:07.270 103: Array is not allowed in data stores. - Server - DataHandler:37