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

Problems with saving an array into DataStorage please Help??

Asked by 6 years ago
Edited 6 years ago

Hi how are you, i have problem and is saving Arrays with datastore and for that i look for the subject, and I found that with json could be saved arrays then i create this script.

01--// Data Store
02local DataStore = game:GetService("DataStoreService")
03local Data = DataStore:GetDataStore("TestData4")
04 
05--// HTTP Services
06local HttpService = game:GetService("HttpService")
07 
08--// DataTable
09local data = {}
10 
11--// JsonDecode
12local DecodeData = HttpService:JSONDecode(Data)
13 
14 
15--// LoadPlayerData
View all 78 lines...

And I Got This Problem on the ouput:

  • Can't parse JSON
  • Stack Begin
  • Script 'ServerScriptService.GameData', Line 27
  • Stack End`

Please Help i Need This urgent and sorry if the JSON code, it´s bad i´m new with that.

Thank you for the Help

1 answer

Log in to vote
0
Answered by
Amiaa16 3227 Moderation Voter Community Moderator
6 years ago

That's because you're trying to store a BrickColor in the DataStore.

Store its name instead, and then when loading the data, turn it back with BrickColor.new()

0
Thanks it works :) imagYTOP 19 — 6y
Ad

Answer this question