Heya!
I’m low-key confused and I feel like I’m doing something obvious wrong. The Datastore prints out the correct key but the value (print data.value) is wrong. It prints out 0 even though it’s 100.
I tested the Datastore and there is 100% 100 in it. I read through the DataStore Article and multiple Forum Posts and I just can’t fix this.
--Get Core Stuff
local DatastoreService = game:GetService('DataStoreService')
local DonatorsDatastore = DatastoreService:GetOrderedDataStore('DonationLeaderboardTEST')
local Players = game:GetService('Players')
local SurfaceGUI = script.Parent
local Display = SurfaceGUI.ScrollingFrame
local DonatorsShown = 100
local InOrder = true
local WaitTime = 120
while wait(10) do
local pages = DonatorsDatastore:GetSortedAsync(InOrder, DonatorsShown)
--Reset
for i, v in Display:GetChildren() do
if v:IsA('Frame') then
v:Destroy()
end
end
--Create
for rank, data in pages:GetCurrentPage() do
print(rank)
print(data.value)
print(data.key)
print(data)
local UserID = data.key
local Amount = data.value
local Rank = rank
local Name = Players:GetNameFromUserIdAsync(UserID)
local PlayerPicture = Players:GetUserThumbnailAsync(UserID, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size48x48)
local Sample = script.Sample:Clone()
Sample.Username.Text = Name
Sample.Profile.Image = PlayerPicture
Sample.Profile.Place.Text = Rank
Sample.Robux.Text = Amount
Sample.LayoutOrder = Rank
Sample.Parent = Display
end
end