ERAGON007 Posted January 3, 2021 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? }
Tekken Posted January 3, 2021 Posted January 3, 2021 You can do table = { ["item1"] = "Sandwich", ["item2"] = "Water", -- etc }; Is that what you need? Resources I made: attachToBones - A newer bone_attach. Simple Level system - Just a simple level system. Do not PM me for help with leaked scripts! I WILL NOT HELP YOU!
ERAGON007 Posted January 8, 2021 Author 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')
Moderators IIYAMA Posted January 8, 2021 Moderators 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 Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
ERAGON007 Posted January 16, 2021 Author Posted January 16, 2021 Oh thanx Bro , that's what i needed! 1
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