Monti18 Posted July 8, 2021 Share Posted July 8, 2021 Oh that's right, you need to remove the items when you add them to a bundle. local function SpawnBundle(inst) local items = {} for i, v in ipairs(inst.stored_items) do local spawned_item = SpawnSaveRecord(v) table.insert(items, spawned_item) end local bundle = SpawnPrefab("bundle") bundle.components.unwrappable:WrapItems(items) inst.components.inventory:GiveItem(bundle) for i,v in ipairs(items) do v:Remove() end end This can also be seen in the bundle from the hermitcrab: local function createbundle(inst,gifts) local final = {} if #gifts >0 then local pouch = SpawnPrefab("hermit_bundle") local prize_items = {} for _, p in ipairs(gifts) do table.insert(prize_items, SpawnPrefab(p)) end pouch.components.unwrappable:WrapItems(prize_items) for i, v in ipairs(prize_items) do v:Remove() end table.insert(final,pouch) end 1 Link to comment Share on other sites More sharing options...
GalaxySugar Posted July 8, 2021 Author Share Posted July 8, 2021 Ah, great thats actually everything I have table related done! thank you once again for everything you've done to help! 1 Link to comment Share on other sites More sharing options...
Monti18 Posted July 8, 2021 Share Posted July 8, 2021 You're welcome! If you get other problems, don't hesitate to ask! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now