|
| 30 Nov 2015 06:56 PM |
| Just the concept, I'm struggling on figuring this out. |
|
|
| Report Abuse |
|
|
litawolf
|
  |
| Joined: 26 Feb 2013 |
| Total Posts: 396 |
|
|
| 30 Nov 2015 06:58 PM |
a table
{ nil, {"Sword", ["dmg"] = 5}, nil, nil, {"Helmet", ["armor"] = 5} }
something like that
➳Lɪᴛᴀʟᴇʟᴀ ɪs ᴍʏ ɴᴀᴍᴇ, Lᴜᴀ ɪs ᴍʏ ɢᴀᴍᴇツ |
|
|
| Report Abuse |
|
|
East98
|
  |
| Joined: 17 Jun 2012 |
| Total Posts: 418 |
|
|
| 30 Nov 2015 08:01 PM |
| Also you could used the Backpack object of each Player object to stroe tools and disable the CoreGui then make your own unique guis. |
|
|
| Report Abuse |
|
|
| |
|
|
| 30 Nov 2015 08:50 PM |
| Couldn't you just use metatables and run functions through every time something is added to the inventory.. |
|
|
| Report Abuse |
|
|
|
| 30 Nov 2015 08:57 PM |
I've done this over a bunch of times, here's what you do:
1) Make a set of boxes, GUI boxes. You only need to make one. Then you just need to define some math that will generate the others. This is very important for organization. Make sure that the script names each one so that they are listed in the order they actually are (that's why loops make this so much easier). Make a nested loop that generates five spaced boxes five times, shifting it down each row.
2) Inside each of those boxes is a set of values that determine how the box acts. Some common ones are Name, Description, and Image that choose what's displayed in the inventory. At the BARE MINIMUM you need to store what's inside the slot and whether the slot is taken or not. You also need a script to change the slot whenever the values are changed.
3) Whenever you pick up an item (how you decide what's an item and what isn't is up to you), loop over every slot and choose the first one that isn't taken. They should loop in order because of Step 1. After that just fill in the values and let the inventory handle displaying it.
4) You need some sort of system that can read the values of a slot and spit out a physical item or action, that way the slot can actually be used in the game. The action that happens is based on what's in the slot so you need some sort of system that can run different scripts on the fly. This is by far the hardest part and I get stuck here a lot. I can help with a few bits, but godspeed. |
|
|
| Report Abuse |
|
|
|
| 30 Nov 2015 09:00 PM |
local Inventory = { }
for i, Items in pairs (Inventory) do Inventory[i+1] -- im too lazy just run through the inventory end
|
|
|
| Report Abuse |
|
|
Link5659
|
  |
| Joined: 04 Jun 2012 |
| Total Posts: 4525 |
|
|
| 30 Nov 2015 09:01 PM |
| WHY DO YALL HELP HIM AND FORGET MEE WHAT DID I DO?!?!?! |
|
|
| Report Abuse |
|
|