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

Ordered Datastore issue; Array not allowed in DataStore. Help?

Asked by
Netflixy 126
8 years ago

I'm having issused with my ordered datastore. The error: Array is not allowed in DataStore. It's on line 3.

The script:

local DataStore = game:GetService("DataStoreService"):GetOrderedDataStore("Teststore1")

DataStore:SetAsync("32", {"1111", 11, "223"})

All help would be appreciated.

2 answers

Log in to vote
1
Answered by 8 years ago

I have just done some testing as I wanted for find this out as well. Though the API does specify a 'Variant' type, an OrderedDataStore will only accept an integer value. If you want to store a table you must use a GlobalDataStore.

Example save format:-

local DataStore = game:GetService("DataStoreService"):GetOrderedDataStore("test")

DataStore:SetAsync('test',  10)

I hope this helps.

Ad
Log in to vote
0
Answered by
shayner32 478 Trusted Moderation Voter
8 years ago

Datastores do not support mixed tables, try

{"1111", "11", "223"}

instead for your table.

0
Changing 11 to a string doesn't change anything. Still the same error. Netflixy 126 — 8y

Answer this question