Impara
Classe motore
GlobalDataStore
Non costruibile
Non Replicato

*Questo contenuto è tradotto usando AI (Beta) e potrebbe contenere errori. Per visualizzare questa pagina in inglese, clicca qui.


Sommario
Metodi
IncrementAsync(key: string,delta: number,userIds: {any},options: DataStoreIncrementOptions):Variant
OnUpdate(key: string,callback: function):RBXScriptConnection
Obsoleto
SetAsync(key: string,value: Variant,userIds: {any},options: DataStoreSetOptions):Variant
UpdateAsync(key: string,transformFunction: function):Tuple
Membri ereditati

Riferimento API
Metodi
GetAsync
Resa
Capacità: DataStore
GlobalDataStore:GetAsync(
Parametri
key:string
Valore predefinito: "nil"
Restituzioni

IncrementAsync
Resa
Capacità: DataStore
GlobalDataStore:IncrementAsync(
key:string, delta:number, userIds:{any}, options:DataStoreIncrementOptions
):Variant
Parametri
key:string
delta:number
Valore predefinito: 1
userIds:{any}
Valore predefinito: "{}"
Valore predefinito: "nil"
Restituzioni
Variant

OnUpdate
Obsoleto

RemoveAsync
Resa
Capacità: DataStore
GlobalDataStore:RemoveAsync(key:string):Tuple
Parametri
key:string
Restituzioni

SetAsync
Resa
Capacità: DataStore
GlobalDataStore:SetAsync(
key:string, value:Variant, userIds:{any}, options:DataStoreSetOptions
):Variant
Parametri
key:string
value:Variant
userIds:{any}
Valore predefinito: "{}"
Valore predefinito: "nil"
Restituzioni
Variant

UpdateAsync
Resa
Capacità: DataStore
GlobalDataStore:UpdateAsync(
key:string, transformFunction:function
Parametri
key:string
transformFunction:function
Restituzioni

BatchGetAsync
Resa
Capacità: DataStore
GlobalDataStore:BatchGetAsync(
keys:{any}, options:Dictionary
Parametri
keys:{any}
options:Dictionary
Valore predefinito: "nil"
Restituzioni
Campioni di codice
Recupera in batch i punteggi dei giocatori
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 .. " non ha alcuna voce salvata")
end
end
end

© 2026 Roblox Corporation. Roblox, il logo Roblox e Powering Imagination sono tra i nostri marchi registrati e non registrati negli Stati Uniti. e altri paesi.