i want to save a value which is not in leaderstats check this script but it does not work
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 do not work please help
