generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: How would you go about making an inventory system?

Previous Thread :: Next Thread 
greedyawesomeman is not online. greedyawesomeman
Joined: 18 Apr 2010
Total Posts: 1038
30 Nov 2015 06:56 PM
Just the concept, I'm struggling on figuring this out.
Report Abuse
litawolf is not online. 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 is not online. 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
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
30 Nov 2015 08:47 PM
oo
Report Abuse
TheOfficialEpicx is not online. TheOfficialEpicx
Joined: 07 Nov 2012
Total Posts: 517
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
wonderful72pike is not online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
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
TheOfficialEpicx is not online. TheOfficialEpicx
Joined: 07 Nov 2012
Total Posts: 517
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image