学ぶ
エンジンクラス
OrderedDataStore
作成できません
複製されていません

*このコンテンツは、ベータ版のAI(人工知能)を使用して翻訳されており、エラーが含まれている可能性があります。このページを英語で表示するには、 こちら をクリックしてください。


概要
方法
GetSortedAsync(ascending: boolean,pagesize: number,minValue: Variant,maxValue: Variant):DataStorePages
継承されたメンバー
コードサンプル
OrderedDataStore の基本
local DataStoreService = game:GetService("DataStoreService")
local pointsStore = DataStoreService:GetOrderedDataStore("Points")
local function printTopTenPlayers()
local isAscending = false
local pageSize = 10
local pages = pointsStore:GetSortedAsync(isAscending, pageSize)
local topTen = pages:GetCurrentPage()
-- 'topTen' のデータはページ上のインデックスがインデックスとして保存されています
-- 各アイテムについて、 'data.key' は OrderedDataStore のキーで、 'data.value' は値です
for rank, data in ipairs(topTen) do
local name = data.key
local points = data.value
print(name .. " のランクは #" .. rank .. " で、 " .. points .. "ポイントです")
end
-- 次のページを読み込む可能性があります...
--pages:AdvanceToNextPageAsync()
end
-- データを作成します
pointsStore:SetAsync("Alex", 55)
pointsStore:SetAsync("Charley", 32)
pointsStore:SetAsync("Sydney", 68)
-- 上位10人のプレイヤーを表示します
printTopTenPlayers()

APIリファレンス
方法
GetSortedAsync
イールド
機能: DataStore
OrderedDataStore:GetSortedAsync(
ascending:boolean, pagesize:number, minValue:Variant, maxValue:Variant
パラメータ
ascending:boolean
pagesize:number
minValue:Variant
maxValue:Variant

©2026 Roblox Corporation。Roblox(ロブロックス)、RobloxロゴおよびPowering Imaginationは、米国並びにその他の国における登録商標および非登録商標です。