Noah
32
Great!
Now, we need to loop through the table, we can do this with a forloop.
Then we can say, if the name doesn’t match, then we don’t destroy.
local CanNotDelete = {"Investor", "First Class", "Business", "Economy", "Passport", "Suitcase"}
local DeleteItems = game.ReplicatedStorage.BinSystem:FindFirstChild("Bins")
DeleteItems.OnServerEvent:Connect(function(player)
for i, v in ipairs(player.Backpack:GetDescendants()) do
for i, v in pairs (DeleteItems ) do
if v ~= Tool.Name then
v:Destroy()
end
end
end
end)
Try something like this.