of     1   

Hunter4529
#146537964Sunday, September 21, 2014 10:20 PM GMT

^ make an inventory system. I'm not to good with tables, would tables be the best way?
Fatalizer
#146538024Sunday, September 21, 2014 10:21 PM GMT

Define "Inventory System", please. ~ I don't rekt kids, I eat them ~
Hunter4529
#146538083Sunday, September 21, 2014 10:22 PM GMT

Just a system to pickup/drop items. Like magazines,guns, or attachments and such.
Fatalizer
#146538249Sunday, September 21, 2014 10:25 PM GMT

That will only be stored in your "inventory", won't do anything if you run a table for you inventory when picking something up from Workspace. ~ I don't rekt kids, I eat them ~
Hunter4529
#146538517Sunday, September 21, 2014 10:28 PM GMT

I don't think you get what I mean. I'm making a Custom Gui for the inventory, and a custom way to pick items up.
Fatalizer
#146538586Sunday, September 21, 2014 10:29 PM GMT

Use table's. ~ I don't rekt kids, I eat them ~
eLunate
#146538601Sunday, September 21, 2014 10:29 PM GMT

Personally, my inventory systems don't use tables. Just use a datastructure made of models inside of the player, so it goes Player > Inventory > Slot[i] > Name/Quantity/Type Type can be done however you like. Normally I use an ObjectValue linked back to a class in the ServerStorage
Hunter4529
#146538950Sunday, September 21, 2014 10:33 PM GMT

Ok thanks :) I thought of that, but I figured tables would be more efficient.
Funse
#146539403Sunday, September 21, 2014 10:40 PM GMT

>Dictionairys
Hunter4529
#146539707Sunday, September 21, 2014 10:43 PM GMT

Ive never used them before, are they fairly advanced?
Funse
#146539747Sunday, September 21, 2014 10:44 PM GMT

no ew no easy as pie
eLunate
#146539809Sunday, September 21, 2014 10:44 PM GMT

They're the same as tables, since Lua doesn't have a dictionary class.
Funse
#146539871Sunday, September 21, 2014 10:45 PM GMT

"They're the same as tables" no... what?
Hunter4529
#146539876Sunday, September 21, 2014 10:45 PM GMT

Ok I looked into it, I think ill give it a try
Fatalizer
#146540021Sunday, September 21, 2014 10:47 PM GMT

local Tab = {} --This is an empty table local Tab = {"value"} --This is a table with a value in it local Tab = {"value1", "value2"} --This is a table with multiple values in it local Tab = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} --This table has numbers in it. local Tab = {1,2,3,4,5,5,6,7,8,9,10,11,12,13,14,15} --A table can have lots of values in it local Tab = {"Hi", 1, Vector3.new(1,1,1), function() print("hello") end} --A table can have different types of values in it local Tab = {{}, {{}, {}}, {}} --A table can even have another table in it local Tab = {"hello", "world"} --A table with 2 strings in it print(Tab[1], Tab[2]) --Printing the contents of the table, indexing is done using [] local Dictionary = {Hello = "hi"} --A dictionary, key value pairs print(Dictionary.Hello) --Indexing a dictionary local TabDictionary = {1, 2, Hello = "hi", "XD" = 1} --Both a table and dictionary in one! This can get complicated however --[[There are also multiple types of functions that can be used with tables, many of them are included in the table library, however there are others such as pairs, ipairs, next, and unpack --]] ~ I don't rekt kids, I eat them ~
Fatalizer
#146540087Sunday, September 21, 2014 10:48 PM GMT

Here are a few links if you still don't understand: ROBLOX WIKI: http://wiki.roblox.com/index.php?title=Table http://wiki.roblox.com/index.php?title=Table_Manipulation OTHER LUA SOURCES: http : / / lua - users . org / wiki / TablesTutorial http : / / www . lua . org / pil / 2 . 5 . html http : / / www . lua . org / manual / 5 . 1 / manual . html # 5 . 5 For some more advanced table usage look here: http://wiki.roblox.com/index.php?title=Linked_lists http : / / www . lua . org / pil / 11 . 3 . html http://wiki.roblox.com/index.php?title=Stack http://wiki.roblox.com/index.php?title=Set_(collection) http://wiki.roblox.com/index.php?title=Metatables http : / / www . lua . org / manual / 5 . 1 / manual . html # 2 . 8 http : / / www . lua . org / pil / 13 . html http://wiki.roblox.com/index.php?title=Weak_Tables http : / / www . lua . org / pil / 17 . html http : / / www . lua . org / manual / 5 . 1 / manual . html # 2 . 10 . 2 ~ I don't rekt kids, I eat them ~
eLunate
#146540097Sunday, September 21, 2014 10:48 PM GMT

Yeah, they're just tables that aren't arrays.

    of     1