So, I followed a Tutorial , but my code doesn't work for some reason. (This is my first question on this website and also sorry for bad english) code:
local DataStoreService = game:GetService("DataStoreService") local PlayerLevelStore = DataStoreService:GetOrderedDataStore("PlayerLevelStore") -- Put the data in local PlayerLevels = { ["CalledMonk12"] = 61, ["SallyWacky"] = 25, ["NancyPlays"] = 82, ["AwasomeMinecraftYT"] = 11, ["Daimian111"] = 111 } for User, Level in pairs(PlayerLevels) do PlayerLevelStore:SetAsync(User, Level) end local Pages = PlayerLevelStore:GetSortedAsync(false, 3) while wait() do local Data = Pages:GetCurrentPage() for i, v in pairs(Data) do print(v.Key) print(" - ") print(v.Value) end if Pages.IsFinished() then break else print("---------------------") -- Next page Pages:AdvanceToNextPageAsync() end end
output:
nil - nil nil - nil nil - nil 04:49:12.055 - ServerScriptService.Script:22: attempt to call a boolean value
More information: Testng style: I use "Run" In roblox studio Script type and location: Script type: Server script Script location: ServerScriptService
The error is your code:
22 if Pages.IsFinished() then
should be:
22 if Pages:IsFinished() then
the other error might be
v.Value -- try v on its own