التعلُّم
Engine Class
GlobalDataStore
Not Creatable
Not Replicated

*This content will be available in your selected language soon.


Summary
Methods
IncrementAsync(key: string,delta: number,userIds: {any},options: DataStoreIncrementOptions):Variant
OnUpdate(key: string,callback: function):RBXScriptConnection
Deprecated
SetAsync(key: string,value: Variant,userIds: {any},options: DataStoreSetOptions):Variant
UpdateAsync(key: string,transformFunction: function):Tuple
Inherited Members

API Reference
Methods
GetAsync
Yields
Capabilities: DataStore
GlobalDataStore:GetAsync(
Parameters
key:string
Default Value: "nil"
Returns

IncrementAsync
Yields
Capabilities: DataStore
GlobalDataStore:IncrementAsync(
key:string, delta:number, userIds:{any}, options:DataStoreIncrementOptions
):Variant
Parameters
key:string
delta:number
Default Value: 1
userIds:{any}
Default Value: "{}"
Default Value: "nil"
Returns
Variant

OnUpdate
Deprecated

RemoveAsync
Yields
Capabilities: DataStore
GlobalDataStore:RemoveAsync(key:string):Tuple
Parameters
key:string
Returns

SetAsync
Yields
Capabilities: DataStore
GlobalDataStore:SetAsync(
key:string, value:Variant, userIds:{any}, options:DataStoreSetOptions
):Variant
Parameters
key:string
value:Variant
userIds:{any}
Default Value: "{}"
Default Value: "nil"
Returns
Variant

UpdateAsync
Yields
Capabilities: DataStore
GlobalDataStore:UpdateAsync(
key:string, transformFunction:function
Parameters
key:string
transformFunction:function
Returns

BatchGetAsync
Yields
Capabilities: DataStore
GlobalDataStore:BatchGetAsync(
keys:{any}, options:Dictionary
Parameters
keys:{any}
options:Dictionary
Default Value: "nil"
Returns
Code Samples
Batch retrieve player scores
local DataStoreService = game:GetService("DataStoreService")
local playerScores = DataStoreService:GetOrderedDataStore("PlayerScores")
local keys = {"Player_123", "Player_456", "Player_789"}
local success, results = pcall(function()
return playerScores:BatchGetAsync(keys)
end)
if success then
for _, key in keys do
local entry = results[key]
if entry then
print(key .. " : " .. tostring(entry.value))
else
print(key .. " has no saved entry")
end
end
end

©2026 شركة Roblox Corporation. تُعد منصّة Roblox، وشعار Roblox وشعار "توسيع حدود المخيلة"، من ضمن علاماتنا التجارية المسجّلة وغير المسجّلة في الولايات المتحدة وبلدان أخرى.