I have been using the FireBase Service and I keep receiving an error, "Argument 2 missing or nil", but the code isn't missing any arguments.

Data[plr.Name] = {}
        table.insert(Data[plr.Name],#Data[plr.Name]+1,laptime)

print("Sessions/"..SessionID.."/Stats/"..plr.Name.."/"..#Data[plr.Name].."   |   "..laptime)
        local lapnum = #Data[plr.Name]
        local ending = { lapnum = laptime; }
        ending = HttpService:JSONEncode(ending)
        Maindb.SetAsync("Sessions/"..SessionID.."/Stats/"..plr.Name,ending)

The error is on the last line. Any suggestions?

8 comments

0

I think you made a mistake by typing in a period instead of a colon before SetAsync.

0

I don't think that maters...

0

It does. It's a function. I believe that even with Firebase you need a colon.

0

yes it does

0

you can't use a colon with basePart Touched

0

and most roblox functions use only a period or colon in them

0

I think it's module scripts where it doesn't matter

0

Yeah, if it's a module script it doesn't matter. Any other ideas of why the error is popping up?