here it is

for _,v in pairs(backpack:GetChildren())
    if v.Name ~= "Menu" then
        v:Destroy()
    end

so basically it removes all the items in the inventory except for items called Menu thanks

1 comment

0

You should post your entire script, as we have no idea on how was "backpack" defined and what is it