i want a value to be saved but it is in game.workspace.Backpack.Capacity.Value
local dataStoreService = game:GetService("DataStoreService")
local dataStore = dataStoreService:GetDataStore("StorageSave")
game.Players.PlayerAdded:Connect(function(player)
pcall(function()
local Storage = dataStore:GetAsync("User_"..player.UserId)
if Storage then
local value = game.Workspace.Backpack.Capacity.Value
if value then
game.Workspace.Backpack.Capacity.Value = value
end
end
end)
end)
game.Players.PlayerRemoving:Connect(function(player)
pcall(function()
local Backpacksave = {}
table.insert(Backpacksave)
dataStore:SetAsync("User_"..player.UserId,Backpacksave)
end)
end)
this does not save the value please help me

2 comments
thank you so much i dont know why i am so stupid to add the table but thank you so much
No problem! Glad I could help!