#output error after following tutorial - NEW TO SCRIPTING
1 messages · Page 1 of 1 (latest)
print data.key and see what u get its saying unknown user since u are putting an invalid key.
(Also not to be that guy but avoid any of those "Beginner" tutorials where they show u how to make a combat system or anything similar they are traps that just waste ur time (no disrespect to the creators tho). If I were u id try to do small projects when starting out like changing a parts color or moving it.)
it just didnt print anything and thanks for that advice
also its working on a diff baseplate i have just not on the main one
if that changes anything
yea you might have missed a line or something then
whats the tutorial ur following out of curiosity
How to Make A Global Leaderboard in Roblox Studio
Hey guys! Welcome back to a brand new roblox scripting tutorial. In today's video I am going to be teaching you guys how to make a global leaderboard in roblox studio. It's actually pretty simple and not as difficult as some of you might think. Leave a like if you enjoyed and be sure to subscrib...
oh yea devking yea hes goated ok thats actually a good tutorial
yhyh all the other tuts told me to download models but i aint doin that
** You are now Level 4! **
just make sure u understand the code dont be afraid to use chatgtp to help u explain code lines just dont use it to code for you thats cringe
yea just understand the logic thats whats important
alr alr
working on a diff baseplate tho but not on the main one im using
hmmm can u paste the full code for it I might be able to check it. I havent worked with datastores in LOOOOONNGG time so im rusty but ill try my best
bit too long for disc sry
ignore the that was before i converted to a file
"```"*
yea u do lua code here
oh im dumb I mean 3 then write lua then close with 3
BRO
use 3 of ` then type lua close it with 3 of them again
did that work
"lua "
local DataStoreService = game:GetService("DataStoreService")
local KillsLeaderboard = DataStoreService:GetOrderedDataStore("KillsLeaderabord")
local function updateLeaderboard()
local success, errorMessage = pcall(function()
local Data = KillsLeaderboard:GetSortedAsync(false, 5)
local KillsPage = Data:GetCurrentPage()
for Rank, data in ipairs(KillsPage) do
local userName = game.Players:GetNameFromUserIdAsync(tonumber(data.key))
local Name = userName
local Kills = data.value
local isOnLeaderboard = false
for i, v in pairs(game.Workspace.GLOBALLeaderboard.GlobalLeaderboard.LeaderboardGUI.Holder:GetChildren()) do
if v.Player.Text == Name then
isOnLeaderboard = true
break
end
end```
???
it wont go thru
yh hold up
oh I already see the problem
?? what i do
ur running this game in studio u might think its using ur actual player id but its using the test players id which is 1
thats why it works when u play it in the actual game
so the code works it just doesnt work in studio. (Well it does work in studio but ur saving data for the test player which is id 1 so its still on the database its just kinda useless
still not working 😔
works in studio in the other baseplate
oh is the other baseplate the copied file? and is the one u have currently the one u tried to make urself?
the other baseplate i refollowed the tutorial to see if i did anything wrong
i followed it and everything worked perfectly
so i copied that into what i'll call the main game
and im getting that output
hmmmmmmmmmmmmmmmm they both worked while in studio right?
ok can u try printing out this line: game.Players:GetNameFromUserIdAsync(tonumber(data.key))
its in the updateleaderboard function
Aye bro i can change ur baseplates color dw
still the same but im also getting this error
DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Key = 1997583270```
yea u querying ur database wayy too often. Since u gotta send a request to roblox servers to view the data and get it back which takes time and is expensive. its why games have auto saves every like 5 mins or so instead of every second
still nothing 😔
is it still giving u request added to queue error?
are u still able to add people to ur roblox games or did they remove that cause of id verification I would probs be easier if I take a look
no
yea lowkey it might just be easier if I take a look at the game
alr whats ur user
Rowdy_Monkey
accept
whats ur user
oh I see its joyus
k u can add me to ur game now
ok im in ill see if I can see the problem
alr ty
yea see here the problem is that we have -1 and -2 then we have ur player id it errors since -1 and -2 is an invalid user since u used the test players
BOOYAH it works
YOOO MY GOAT
I just ran this command:
KillsLeaderboard:RemoveAsync(-1)
KillsLeaderboard:RemoveAsync(-2)
my goat bro tysm
np bro goodluck on ur scriping journey 👍
Inv me to your scripting journey bro 🙏
ok brother❤️
W