ERAGON007 Posted January 3, 2021 Share Posted January 3, 2021 Hi, so i want to make an inventory system and now i don't know where to start coding the part that combines items and gets new items currently i have Quote items = { "Water", -- Item 1 "Sandwitch", -- Item 2 } and now what to do next? is this right? Quote combine_list = { -- In What Format? } Link to comment
Tekken Posted January 3, 2021 Share Posted January 3, 2021 You can do table = { ["item1"] = "Sandwich", ["item2"] = "Water", -- etc }; Is that what you need? Link to comment
ERAGON007 Posted January 8, 2021 Author Share Posted January 8, 2021 On 03/01/2021 at 14:54, Tekken said: You can do table = { ["item1"] = "Sandwich", ["item2"] = "Water", -- etc }; Is that what you need? I already made this part , but idk how to code the part to combine items for example combinig 'item1' with 'item2' gets a new item e.g ('item3') Link to comment
Moderators IIYAMA Posted January 8, 2021 Moderators Share Posted January 8, 2021 (edited) 1 hour ago, ERAGON007 said: for example combinig 'item1' with 'item2' gets a new item e.g ('item3') Just some format examples, the right format depends on how you work with them: itemProperties = { ["water"] = { ["friendlyName"] = "Water" }, ["sandwitch"] = { ["friendlyName"] = "Sandwitch" } } items = { ["water"] = {-- Item 1 ["amount"] = 2 }, ["sandwitch"] = {-- Item 2 ["amount"] = 1 }, } -- or items = { {-- Item 1 ["amount"] = 2, ["id"] = "water" }, {-- Item 2 ["amount"] = 1, ["id"] = "sandwitch" }, } combine_list = { { ["ingredients"] = { ["water"] = 2, -- 2x water ["sandwitch"] = 1, -- 1x sandwitch }, ["newItem"] = "water sandwitch" }--[[, { -- next combination ["ingredients"] = { ["water"] = 2, -- 2x water ["sandwitch"] = 1, -- 1x sandwitch }, ["newItem"] = "water sandwitch" }]] } Edited January 8, 2021 by IIYAMA 1 Link to comment
ERAGON007 Posted January 16, 2021 Author Share Posted January 16, 2021 Oh thanx Bro , that's what i needed! 1 Link to comment
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