Hello! I'm currently making a survival game in Roblox but I've hit a roadblock. I'm new scripting use LUA. I'm not sure how to create a basic inventory and I'm looking for a point in the right direction. I've researched tables but I'm not making the connection :c I put the set up I have going on as images in this post. https://ibb.co/QdwbT5T (https://ibb.co/w7qPwgB)
So hope this works and that you will get better at lua. heres how to make a table:
local TestTable = {value1,value2,value3}
you can insert as many values as you would like. This is an array table by the way. I did not name the table variable 'table' because table is a keyword in lua. Please mark as answered if this helped!
The best thing to do is to create all of the frames automatically and handle it all in a for loop. That's what I do, at least.
```lua for X = 1, 4 do for Y = 1, 12 do local Frame = Instance.new("Frame") Frame.Size = UDim2.new(0, 50, 0, 50) Frame.Posititon = UDim2.new(0, 50 * X + 10, 0, 50 * Y + 10)
-- Recommended to add a TextButton but make it transparent to handle clicking and stuff Button.MouseButton1Click:Connect(function() -- When an inventory button is clicked... end) end
end ``` Hope this helps.
Patch