Where do I go next with scripting an inventory system

hi, im working on scripting an inventory system like escape from tarkov but im really lost on what to do next. i’ve made code to generate items and containers

local module = {}
-- written by lukethebestpug, 9/23/23

local assets = script.Parent.assets
local player = game:GetService("Players").LocalPlayer

local function generategrid(x, y)
	local data = {}
	for i = 0, x, 1 do
		for e = 0, y, 1 do
			local griddata = {i,e, taken = false}
			table.insert(data, griddata)
		end
	end
	return data
end

function module.NewContainer(config:Configuration)
	local ui = assets.ui[config.Name]
	
	local container = assets.storagetemplate:Clone()
	container.Name = config.Name
	container.Icon.ImageLabel.Image = ui:GetAttribute("Icon")
	
	container.Parent = assets.containers
	container.Icon.label.Text = config.Name
	
	local slotx = ui:GetAttribute("SlotSizeX")
	local sloty = ui:GetAttribute("SlotSizeY")
	container.Size = UDim2.new(0,357,0,100*sloty)
	local slotcount = ui:GetAttribute("SlotCount")
	local slots = container.Slots
	local count = 1
	
	for i = 1, slotx, 1 do
		for e = 1, sloty, 1 do
			local x, y = slotx*35, sloty*35
			local grid = assets.Grid:Clone()
			grid.Parent = container.Slots.Slot
			grid.Name = tostring(count)
			grid.LayoutOrder = count
			count = count+1
		end
	end
	
	slots.UIGridLayout.CellSize = UDim2.new(0,35*slotx,0,35*sloty)
	slots.UIGridLayout.FillDirectionMaxCells = slotcount
	if slotcount ~= 1 then
		for i = 1,slotcount-1,1 do
			local grid = container.Slots.Slot:Clone()
			grid.Parent = container.Slots
		end
	end
	slots.Slot.UIGridLayout.FillDirectionMaxCells = slotx
	
end

function module.NewTool(config:Configuration)
	local tool = assets.item:Clone()
	local actualtool = game:GetService("ReplicatedStorage"):WaitForChild("Tools"):WaitForChild(config.Name):Clone()
	actualtool.Parent = tool
	tool.Parent = assets.tools
	tool.Name = config.Name
	tool.Image = ("rbxassetid://" .. config:GetAttribute("Icon"))
	tool.Size = UDim2.new(0,config:GetAttribute("SizeX")*35,0, config:GetAttribute("SizeY")*35)
end

return module

but thats it. im extremely lost on what to do next and some help would be appreciated

What do you mean lost on what to do next, what exactly isn’t working?

Do you need help with scripting or do you need ideas to challenge yourself? You said you’re making an inventory similar to tarkov, but not exactly copying it correct? So you want ideas/suggestions to improve your current inventory?

its not that it isnt working, im just lost on what to script next, like do i make tools equipable? do i add models so they can be dropped? do i make the interaction system? do i make items move between grids? it just feels like everything depends on something else and inorder to make that dependancy, i have to make something else and it keeps cycling over and over like that

i almost want to say i cant do it.

Well you said its based off tarkov so try incorporating mechanics that it has in it’s inventory system?

its about making the mechanics work that is the problem

I don’t see it. Why not just go for one of the ones you listed: drop model? i.e. right click to drop and it removes from inventory.

1 Like

yea i guess i was just getting panicked, this whole topic was stupid and im sorry for wasting your time

complex systems: break it down to what you need to do. ex; dropping requires picking up, which requires moving items, so make items move

It’s no problems, it probably happens to all of us. Best you can do is just go for it, if it happens then it happens.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.