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

Can someone help me with my error in Save Script?

Hi, my game printing data store issue but i dont understand that. Previous code what work:

local DataStoreService = game:GetService('DataStoreService')
local playerData = DataStoreService:GetDataStore('PlayerData')
data = {p.Diamonds.Value, p.Coins.Value, p.LVL.Value, p.EXP.Value, p.GUN.Value, p.KNIFE.Value, p.JDiamonds.Value, p.ABILITY.Value}
playerData:SetAsync(p.UserId, data)

New code what don't work:

local DataStoreService = game:GetService('DataStoreService')
local playerData = DataStoreService:GetDataStore('PlayerData')
data = {p.Diamonds.Value, p.Coins.Value, p.LVL.Value, p.EXP.Value, p.GUN.Value, p.KNIFE.Value, p.JDiamonds.Value, p.ABILITY.Value, p.LEgg.Value, p.Armor.LeftLeg.Value, p.Armor.RightLeg.Value, p.Armor.Torso.Value, p.Armor.LeftArm.Value, p.Armor.RightArm.Value, p.Armor.Head.Value}
playerData:SetAsync(p.UserId, data)

Error: Cannot store Array in DataStore. Thanks for helping - kurka123

2 answers

✓ Accepted answer

I think that the problem you are having is due to you trying to save instances to the datastore, unfortunately you cannot do that. Try finding a way around it, or look at this.

1 comment

0

No... That's not it. PS p.Diamonds = String value p.Coins string value etc... All of that is only string value

Problem resolved! I made it using 2 datastores ("PlayerData" and "PlayerDataArmor")

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