#Global Leaderboard.
1 messages · Page 1 of 1 (latest)
wym?.
** You are now Level 1! **
you dont see the functions?
a
thanks but its not working properly its been 6 hours now of bug fixing xd
i am very burnt out the problem could be in my face and i still dont see it xd
wait what userservice be
I never done anything with global shit so ama head out
if the data in the stores are 0 then it's a problem with saving data
well the data is not 0 xd
i'd wager this is happening because you're changing values on the client when this should be done on the server
@little solar good logic indeed
** You are now Level 11! **
hmmm
very common beginner mistake
yeah that makes sense, i should really learn dss tho
@rigid prawn it needs to be on server
the client is the player
everything is on server
even saving?
also done through server script
Since i can see the values of data in the actual data store in roblox there shouldn't be a client mistake
what is the data you see?
you said they're all 0
so its a reading problem
maybe you're printing to much
the getuserids from userservice
doesnt print in order
how many entries
are in the leaderboard
oh 4k
this is the output when i run the game
since i my self have 26 points and many other players got more than 0 they should be here
it is since you can see the data on the actual data store page
** You are now Level 2! **
so its a reading problem definitely
do you want to get your own stats
isnt yours the only one that isnt 0
i just want the top stats thats why i use ordered data store
ooo
.
@little solar any ideas?
show save side
?
show code used to save into it
wait discord aint letting me xd
can you read that or is it too small?
cause for some reason i cant post the whole script
and adding points gets done by another script which uses increment
are you the only one with points above 0
o
above 400 people
actually 439 to be exact
@little solar tell me you got something ;')
this is absolutely horrendous use of datastores, i'm surprised it's working at all without error
HAHAHAHAHA
but yea you're storing 0's
but i am not ?
doesn't much explain this tho
it has to be a reading problem
you are
na its saving only 0's.
but you can see at the data store page there are the values
well to be more specific, it's saving whatever the last value was, or 0, which is always going to be 0 unless they've already got an entry
and the increment works correctly adding points whenever a win occurs
i.e from its current state it will never save new data
it so confuse me
yeah i am totally burnt here
how do i even fix that?
also how could i make the data stores not horrendous xd
i'm fairly certain this is actually not your data
huh
what does that even mean how is it not my data?
we can join a call if that helps
yeah it's not your data
as in, yes it's your data with your userid that's all fine, but that's not the data your code is using
what xD
first the data store was not an ordered data store if thats why this is happening
yep 100% you're looking at the wrong thing
i haven't used the new datastore manager so i just checked a few things and i confirm ordered stores do not show in the datastore manager
yes as i suspected, so you actually have 2 different types of stores with the same name
thats all the data store my game uses
you're looking at the normal store (which your code no longer uses) and seeing old data in it, then wondering why it's all 0's
and then to top it off
-- Function to save player data
function savePlayerData(player)
local success, errorMessage = pcall(function()
local userId = tostring(player.UserId)
local success, errorMessage = pcall(function()
local currentPoints = PointsDataStore:GetAsync(userId) or 0 -- Ensure we get the latest stored points
PointsDataStore:SetAsync(userId, currentPoints) -- Save the existing points without overwriting them
end)
StreaksDataStore:SetAsync(player.UserId, player:GetAttribute("Streak") or 0)
CurrencyDataStore:SetAsync(player.UserId, player:GetAttribute("Currency") or 0)
XPDataStore:SetAsync(player.UserId, player:GetAttribute("XP") or 0)
BPXPDataStore:SetAsync(player.UserId, player:GetAttribute("BPXP") or 0)
end)
if success then
print(player.Name .. "'s data has been saved successfully.")
else
warn("Failed to save data for " .. player.Name .. ": " .. errorMessage)
end
end
local success, errorMessage = pcall(function()
local currentPoints = PointsDataStore:GetAsync(userId) or 0 -- Ensure we get the latest stored points
PointsDataStore:SetAsync(userId, currentPoints) -- Save the existing points without overwriting them
end)```
this is the only place i see a PointsDataStore:SetAsync, and you're using getasync (completely ignoring the attribute you use later), which is guaranteed to be 0 (because of the `or 0`) on first load, and since it never takes new data into it, it is guaranteed to always be 0.
only exception is if they already had data.. in the ordered store, which you wouldn't have had because you changed to a new, completely empty store when you switched from getdatastore to getorderedstore
and now you're confused because you have the old datastore in the dashboard store manager with the same name
so yeah, it's a problem with saving data
(my first theory being correct)
thats actually true
** You are now Level 3! **
😦
this is just insane you don't need 100 stores, in fact you're going to get rate limited doing that real damn fast
all the stuff that doesn't need to go in an ordered store, put it in one regular store as a table
yeah before disabling the leaderboard first day of release i had 50k errors for data requests xd
like {money=2, xp=100, etc} and only the stuff that needs to be ordered are on their own
is there a way to transfer all data too or i have to reset everything to 0?
its been like 5 days from release
the getattributes here are fine, just fix the one you aren't using. also if you're going to getasync() then immediately after do a setasync() on the same store and key, use updateasync instead.
as for this, so in the industry this is usually called migration. it happens when you change datastore methods and design patterns, such as changing how your savedata is structured or moving stores. i don't recommend performing datastore-wide operations since that'll take forever, instead just add a migration function to your loading method that detects if the data is based on an older version, and if so, migrate it to the newer version.
usually this is done by adding a .version=001 etc and incrementing it manually, writing in if not version or version < 1 then ... version=1 end ... if version < 2 then ... version=2 end important to note that you need to keep these sequential, as in, the migration needs to take every step, because you may have players joining still on the first version, or any version in between.
sometimes you can collate all the changes into one step but it's unlikely. running each migration step is often the way to go
as an alternative to using a .version value, you can also go by the date. i don't fully recommend that since it's a bit harder to control, but the option is there
so lets say i have 5 data stores now and make them all 1 what happens to the 5 datastores? Do i delete them somehow?
and if you're wondering why shutting all servers down and running the migration while the game is set to private is not practical, the rate limits are too low, you'll be waiting for hours if not days for it to finish, even at 'only' 4000 players.
So is it easier to just reset everything?
you don't. too bad. they're there forever. just ignore them. best you can do is removeasync as part of the migration (since removeasync is also subject to rate limits)
so they dont take much space ig yeah
is there any chance we can get in a call and help me with all that?
and in case it hasn't properly hit you yet just how deep of a hole you've managed to get yourself into, here are the rate limits.
Each queue has a limit of 30 requests. When the limit of a queue is reached, requests fail with an error code in the 301-306 range, indicating that the requests have been dropped entirely.
Get GetAsync() 60 + numPlayers × 10
Set (limit is shared among all listed functions) SetAsync()
IncrementAsync()
UpdateAsync()
RemoveAsync() 60 + numPlayers × 10
just be thankful you have less than 10 stores in your code (including the new single-store with table data you're going to be using). barely.
hell no i dont do that kind of thing without adequate remuneration
happy to help you figure out where it's all going wrong and give you an outline of where to take it from there, but i'm not going to do everything for you 
my prices are high since i don't need the work. tbh you should probably look for someone in #👷︱for-hire, or post a job in #💵︱hiring, to write you new datastore code and add in the migration stuff.
oh we won
you had doubts? 
nah i just came back after learning dss
if i actually manage to fix that i will invite yall to see my game xd
@little solar I have made some progress and i think my script should work but it doesn't can you help me out a little bit?
i charge for private help ;o if you got new problems make a new thread 
Well its on the same script but alright ig i can make a new thread xd
sure
give me admin