Lately, I have been working on a game. It has to save an objects position like one in miners haven... I am making Instances and turning them into Vector 3 Values to save them and so far it is giving me an error saying "Cannot Store Array In DataStore" Can someone help me?
script error..
local DataStore = game:GetService("DataStoreService"):GetDataStore("HelpMePlease")
game.Players.PlayerRemoving:connect(function(player)
local key = "player-"..player.userId
for _, v in pairs(player.HiddenStats.ItemPos:GetChildren()) do
print("Saving")
valuesToSave = {player.HiddenStats["Item Data Store Name"].Value, v.Value} -- I cannot make this local, It has to be global
print(valuesToSave)
end
DataStore:SetAsync(key, valuesToSave)
end
end)
the data store error is the DataStore:SetAsync(key, valuesToSave) although it should save.. API is on.
Thanks for any help

2 comments
Use Coordinates , X , Y , Z not the whole vector3 value
Oh, Okay