Retreive each item in a table

Hi it’s me again :confused:

I search a way to know if the ent ID who touch my baker is in a specific table, but no way it’s not working.

Concerned part are in init.lua :


function ENT:Initialize()
	for k, v in pairs(CookerAddon.recipes) do
		local name = "add"..v.id

		net.Receive(name,function()
			SetGlobalString("ActiveRecipe",v.id)
			local act = GetGlobalString("ActiveRecipe")
			PrintTable(v.recipe)
			print("----------------------")
			print(act)
		end)
	end
end

function ENT:StartTouch(ent)
	if ent:GetClass() == "ingredient" and self.IsBaking == false then
		local id = GetGlobalString("ActiveRecipe")
		if ent:GetIngID() == CookerAddon.recipes[id].recipe then
			ent:Remove()
			self.IsBaking = true
			self:SetNWInt("IsBaking",1)
			self:SetNWInt("FinishBakeTime", CurTime() + 5)
		end
	end
end

And I have an Entity called ingredient.lua and when i spawned it using my tablet it’s defined an ID and these id are in my table.

My table structure:

  1. My eyes hurt.
  2. You are using the net library wrong. You’ve already been given a link to Net Library Usage in another thread.

I didn’t bother to read the rest of your code or your post because, again, my eyes hurt.

Now thats much better, I understand OP’s problem now, and my eyes stopped hurting, thanks very much!