local DataStore = game:GetService("DataStoreService"):GetDataStore("tools") game.Players.PlayerAdded:connect(function(plr) wait(1) local items = DataStore:GetAsync(plr.UserId) or {} if game.Workspace:FindFirstChild(plr.Name.."'s Holder") == nil then local folder = Instance.new("Folder", game.Workspace) folder.Name = plr.Name.."'s Holder" local folder = Instance.new("Folder", folder) local playername = Instance.new("StringValue",folder) playername.Name = "PlayerName" playername.Value = plr.Name wait(0.5) for i, v in pairs(items) do if game.ReplicatedStorage.tools:FindFirstChild(v) ~= nil then game.ReplicatedStorage.tools:FindFirstChild(v):Clone().Parent = folder end end folder.ChildAdded:Connect(function(C) items[#items+1] = C.Name DataStore:SetAsync(plr.UserId, items) print("Saving to table") end) folder.ChildRemoved:Connect(function(c) items = {} items[#items-1] = c.Name DataStore:SetAsync(plr.UserId, items) print("Something removed from table...Saving table.") end) else print("Alrady has a Holder") end end)
i am new to datastore tables and all im trying to remove the tool from datastore once it is deleted from the folder but it does not work. anything will be great TY.