Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Argument 1 missing or nil on LeaderBoard?

Asked by
3F1VE 257 Moderation Voter
3 years ago

Heres the code :

01local datastore = game:GetService("DataStoreService"):GetOrderedDataStore("Time")
02 
03local function UpdLB()
04local success, errormessage = pcall(function()
05        local data = datastore:GetSortedAsync(false,100)
06        local timepage = data:GetCurrentPage()
07        for rank,data in ipairs(timepage) do
08            local username = game.Players:GetUserIdFromNameAsync(data.Key)
09            local name = username
10            local timee = data.Value
11            local isonlb = false
12            for i, v in pairs(workspace.LB.SurfaceGui.Container.ScrollingFrame:GetChildren()) do
13                if v.User.Text == name then
14                    isonlb = true
15                    break
View all 39 lines...

It warns me in the output "Argument 1 missing or nil" I scanned it 3 times and nothing.

0
do you know which line errored NGC4637 602 — 3y
0
No it just returns "Argument 1 missing or nil" in output and when I click on it, it takes me to like 29. 3F1VE 257 — 3y
0
Line* 3F1VE 257 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

try

01local datastore = game:GetService("DataStoreService"):GetOrderedDataStore("Time")
02 
03local function UpdLB()
04local success, errormessage = pcall(
05        local data = datastore:GetSortedAsync(false,100)
06        local timepage = data:GetCurrentPage()
07        for rank,data in ipairs(timepage) do
08            local username = game.Players:GetUserIdFromNameAsync(data.Key)
09            local name = username
10            local timee = data.Value
11            local isonlb = false
12            for i, v in pairs(workspace.LB.SurfaceGui.Container.ScrollingFrame:GetChildren()) do
13                if v.User.Text == name then
14                    isonlb = true
15                    break
View all 39 lines...
0
What changed? 3F1VE 257 — 3y
0
And it prints nothing. 3F1VE 257 — 3y
0
I think im gonna have to rewrite your script is that okay? WINDOWS10XPRO 438 — 3y
Ad

Answer this question