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

Can someone help me with my error in Save Script?

Asked by
Etheroit 178
9 years ago

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

Log in to vote
0
Answered by 9 years ago

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.

0
No... That's not it. PS p.Diamonds = String value p.Coins string value etc... All of that is only string value Etheroit 178 — 9y
Ad
Log in to vote
0
Answered by
Etheroit 178
9 years ago

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

Answer this question