okay so i didnt really know what to put in the thumbnail but this is my problem
local DSS = game:GetService("DataStoreService")
local DS = DSS:GetDataStore("BackpackSave")
game.Players.PlayerAdded:Connect(function(player)
pcall(function()
local tool = DS:GetAsync("User-"..player.UserId)
if tool then
for i,v in pairs(tool) do
local ToolFound = game.ReplicatedStorage.Tools:FindFirstChild(v)
if ToolFound then
ToolFound:Clone().Parent = player.Backpack
ToolFound:Clone().Parent = player.StarterGear
end
end
end
end)
end)
game.ReplicatedStorage.UpdateInventory.OnServerEvent:Connect(function(player)
pcall(function()
local ToolsSaved = {}
for i, tool in pairs(player.Backpack:GetChildren()) do
if tool then
table.insert(ToolsSaved, tool.Name)
end
end
DS:UpdateAsync("User-"..player.UserId, ToolsSaved)
end)
end)
game.Players.PlayerRemoving:Connect(function(player)
pcall(function()
local ToolsSaved = {}
for i, tool in pairs(player.Backpack:GetChildren()) do
if tool then
table.insert(ToolsSaved, tool.Name)
end
end
DS:SetAsync("User-"..player.UserId, ToolsSaved)
end)
end)
this is my serverscript that is supposed to handle the data it does work but when i :Destroy() the tools from local script during the game they still save when u rejoin and i cant understand why?

3 comments
well the tool is in the players backpack and isnt that local? I thought abt this and i tried doing it from the server but it doesnt seem to work either and i didnt test it with other people but i think it would destroy their tools too wouldnt it?
If I have a tool in my backpack, and I use a localscript to destroy that tool. The destruction of that tool will not be registerd on the server.
I figured it out u gave me an idea thank you :)