coreOrderedDatastore
Summary
The system I’ve produced represents an implementation of an OrderedDatastore
. This system allows you to retrieve a Specific key & update a set of Key-Value
pairs.
Configurables, Functions & Params
--[[
-- Variables
local isDescending = true -- SortingOrder / Ascending or Descending
local convertUserIdToString = true -- Auto convert UserId to string, else pass it as a string manually
local isUsingPromisedUpdate = true -- Using the Built-In UpdateAsync that came with the module
local OrderedDatastoreName = "MyTestingVersion" -- Name of your OrderedDatastore
-- Functions & Params
Retrieves the entry & position of a specified key within an ordered data store.
coreOrderedDatastore:GetOrderedPositionAsync(Key: string | number, Descending: boolean)
@param Key (string | number): The key to search for within the ordered data store. It can be either a string or a number varying on the convertUserIdToString boolean.
@param Descending (boolean): Determines the ascending order when searching for the key. Set to true to search in descending order or false for ascending order.
Asynchronously updates data for a Player in the Datastore
coreOrderedDatastore:UpdateAsync(Player: Player, Key: string, Value: number)
@param Player (Player): The player whose key you want to update.
@param Key (string): The key associated with the player's data. Should be a string.
@param Value (number): The new numeric value to update for the player.
coreOrderedDatastore.new(OrderedDatastoreName: string, ConvertUserIdToString: boolean)
Returns a new OrderedDatastore object
@param OrderedDatastoreName (string): The name of the provided Ordered Datastore
@param ConvertUserIdToString (boolean): Indicates whether user IDs should be converted to strings when interacting with the data store.
@constructor coreOrderedDatastore.new(OrderedDatastoreName: string, ConvertUserIdToString: boolean)
]]
Usage
- Grab the Model Found Here
- Drag the contents into
ServerScriptService
- Setup the configurable variables inside of coreStore to your likings
- Run & Success!
Suggestions & Feedback
If this is in high need, I may maintain the system. If that’s the case, feel free to list features you guys would like to see