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

I get attempt to index nil with 'Car_Plus' how do I fix this?

Asked by 2 years ago
Edited 2 years ago
local tableplayer = ds:GetAsync(player.UserId)
tableplayer[carname] = true

Basicly what im trying to do is to change the table and the name of the table value is the string value that is a local carname

0
You should try checking whether tableplayer is nil or not. Most cases it will be, if there's nothing saved to that key. RAFA1608 543 — 2y
0
actually it was nil! thanks for telling me MrBossNicolas 19 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

I solved it myself by adding a checker once the player joins and it checks if its nil and if it is it sets the default table for them

Ad

Answer this question