SaveUtil
A collection of utility functions for handling datastores.
If you need to access any datastores directly while using DocumentService, it is recommended you use these functions or similar implementations.
Functions
assertStorable
SaveUtil.
assertStorable
(
data:
unknown
,
fieldName:
string?
) →
(
)
Errors if the data passed is not storable in JSON
Rejects: NaN (all numbers must equal themselves) Mixed table index types Non sequential tables indexed by numbers Non-string or number table indexes Cyclic tables type(value) == "userdata" Functions Metatables Threads Vectors
uuid
SaveUtil.
uuid
(
) →
string
Luau uuid implementation.
Based off of https://gist.github.com/jrus/3197011
updateAsync
This is a yielding function. When called, it will pause the Lua thread that called the function until a result is ready to be returned, without interrupting other scripts. YieldsSaveUtil.
updateAsync
(
key:
string
) →
(
)
A wrapper for UpdateAsync that retries with exponential backoff, prevents use of the throttle 'queue', and allows retries to be aborted.
getAsync
This is a yielding function. When called, it will pause the Lua thread that called the function until a result is ready to be returned, without interrupting other scripts. YieldsA wrapper for GetAsync that retries with exponential backoff and prevents use of the throttle 'queue'.
removeAsync
This is a yielding function. When called, it will pause the Lua thread that called the function until a result is ready to be returned, without interrupting other scripts. YieldsA wrapper for RemoveAsync