How to fix data store error


how to fix this problem? i’m get this when i join to game

Check if the data exists first before indexing the array.

Add this in your code before line 55.

if Data then
-- the rest of your code

More information please.
What are you trying to do?
What does Data[1] give?

He/she does on line 55. “if Data[1] then”

According to the error, he doesn’t. The error says that the data is nil.

Well the error has to be because of something else…

The ‘Data’ variable is nil. What code did you use for defining Data?

That’s just an attempt to index the first item of an array named “Data”, if “Data” is nil you’ll receive an error similar to the one in the screenshot.

As suggested the thread’s poster should be doing if Data then, better yet, do if type(Data) == "table" to ensure that “Data” points/refers to a table value before attempting to index it.