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

Table is nil when obviously not, help?

Asked by 3 years ago
Edited 3 years ago

The title says it all it keeps erroring about line 105 when data[plr.name]["endings"] is nil for a new player

code : (VERY LONG)

001-- Ignore the very inefficient code
002local dss = game:GetService("DataStoreService")
003local ed = dss:GetDataStore("testds1")
004local data = {}
005local ndt = {
006    ["endings"] = {},
007    ["rdata"] = {
008        ["ADT"] = "bfft"
009    }
010}
011local gendings = {}
012-- IGNORE UNTIL LINE 105
013local trusted = {
014    Trusteds
015}
View all 182 lines...
0
its nil tho TwoTramp 18 — 3y
0
New player don't have any table (nil) Have you tried to check if the player is new and create the table for them? Somone_exe 224 — 3y
0
i did,line 22-34 anhminh01997 7 — 3y
0
i found the cause on line 33, the nil table is set twice so all of the verification is useless, someone post an answer so i can flag this as answered anhminh01997 7 — 3y

Answer this question