Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

2 comments

0

You should try checking whether tableplayer is nil or not. Most cases it will be, if there's nothing saved to that key.

0

actually it was nil! thanks for telling me

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.