In the game I’m currently working on, there are levels that players can create and upload. I recently added “stats” to those levels, being plays and completions. After adding this, loading levels has taken a very long time. I recently changed the rest of the datastores to also have another directory just for their names and creator, so it can draw the data faster.
This hasn’t helped that much, meaning the only culprit left is the new level stats. I’m not sure what’s causing the issue.
local wins = 0
if completedds:GetAsync(tonumber(v.Name)) then
wins = completedds:GetAsync(tonumber(v.Name))
end
local plays = 0
if playedds:GetAsync(tonumber(v.Name)) then
plays = playedds:GetAsync(tonumber(v.Name))
end
new.Stats.Text = "⬇" .. plays .. " ✅" .. wins
These are the only extra lines, each of these stores only one value, so I don’t see the problem.
Extra info:
- I’m using ODS like this:
local playedds = ds:GetOrderedDataStore("LevelStatsDS","Plays")
local completedds = ds:GetOrderedDataStore("LevelStatsDS","Completions")
- Each key stores one int value for the ODS
If there’s any info I’m missing, please tell me, and if you know the solution, also tell me. Thanks.