Hello, i’ve ran into an issue with my global leaderboard.
--// Services
local DS = game:GetService("DataStoreService")
local RaisedData = DS:GetDataStore("Raised1")
local DonatedData = DS:GetDataStore("Donated1")
--// Dependencies
local RaisedLeader = workspace:WaitForChild("Raised");
local DonatedLeader = workspace:WaitForChild("Donated");
local SurfaceGuiRaised = RaisedLeader:WaitForChild("SurfaceGui");
local SurfaceGuiDonated = DonatedLeader:WaitForChild("SurfaceGui");
local ListRaised = SurfaceGuiRaised:WaitForChild("List");
local ListDonated = SurfaceGuiDonated:WaitForChild("List");
local ItemsRaised = ListRaised:WaitForChild("Items");
local ItemsDonated = ListDonated:WaitForChild("Items");
game.Players.PlayerRemoving:Connect(function(Player)
local UserKeyRaised = Player.UserId
local Success, Error = pcall(function()
RaisedData:SetAsync(UserKeyRaised.."Raised", Player.leaderstats.Raised.Value);
DonatedData:SetAsync(UserKeyRaised.."Donated", Player.leaderstats.Donated.Value);
end)
print(Success)
end)
while true do
print(RaisedData:GetAsync("136346113Raised"))
local DonatedOrderedDatastore = DS:GetOrderedDataStore("Donated1")
local DonatedSorted = DonatedOrderedDatastore:GetSortedAsync(false,100,1,10e15)
local DonatedPage = DonatedSorted:GetCurrentPage()
local RaisedOrderedDatastore = DS:GetOrderedDataStore("Raised1")
local RaisedSorted = RaisedOrderedDatastore:GetSortedAsync(false,100,1,10e15)
local RaisedPage = RaisedSorted:GetCurrentPage()
print(RaisedPage)
task.wait(60)
end
I’m trying to get the page of the datastore, but it just prints {} and 40 Instance.
No errors, just confusion.