Loading...
Loading...
Use for Roblox persistent data and cross-server state design: choosing between DataStoreService, OrderedDataStore, MemoryStoreService, and MessagingService; designing save and load flows, schema shape, versioning, metadata, retries, quotas, observability, and concurrency-safe coordination across servers.
npx skill4agent add stackfox-labs/luau-skills roblox-dataDataStoreServiceSetAsync()UpdateAsync()IncrementAsync()MemoryStoreServiceMessagingServiceUpdateAsync()MessagingServiceroblox-networkingroblox-coreroblox-apiUpdateAsync()nilGetAsync()pcall()references/data-stores-guides.mdreferences/data-store-best-practices.mdreferences/versioning-listing-caching-limits-and-observability.mdreferences/memory-stores-guides.mdreferences/memory-store-best-practices-limits-and-observability.mdreferences/cross-server-messaging.mdreferences/data-stores-vs-memory-stores-comparison.mdUpdateAsync()pcall()SetAsync()GetAsync()MessagingServiceUpdateAsync()local DataStoreService = game:GetService("DataStoreService")
local profileStore = DataStoreService:GetDataStore("PlayerProfiles")
local function saveCoins(userId, delta)
return profileStore:UpdateAsync(("player/%d"):format(userId), function(current, keyInfo)
current = current or {schemaVersion = 1, coins = 0}
current.coins += delta
return current, keyInfo:GetUserIds(), keyInfo:GetMetadata()
end)
end-- Publish: "queue has work"
-- Receiver: read the queue or map, then process authoritative state there.