I wanna DataStore this table because I'm trying to make an inventory script. Thing is, is that it won't save. Any help?
local Datastore = game:GetService("DataStoreService"):GetDataStore("PlayerDataV1");
local itemlist = {}
game.Players.PlayerAdded:Connect(function(Player)
local inv = Instance.new("Folder",Player)
inv.Name = "Inventory"
local ls = Instance.new("IntValue",inv)
ls.Name = "LinkedSword"
ls.Value = 6
local Pistol = Instance.new("IntValue",inv)
Pistol.Name = "Pistol"
Pistol.Value = 7
table.insert(itemlist, ls.Value)
table.insert(itemlist, Pistol.Value)
Datastore:GetAsync(Player.UserId)
end)
game.Players.PlayerRemoving:Connect(function(Player)
Datastore:SetAsync(Player.UserId, itemlist)
end)
