• Retreive each item in a table
    3 replies, posted
Hi it's me again :/ 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 : [CODE]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[/CODE] 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: [IMG]http://image.prntscr.com/image/f3cf72548b0f4fd7bb934d452ce62299.png[/IMG]
1. My eyes hurt. 2. You are using the net library wrong. You've already been given a link to [url=http://wiki.garrysmod.com/page/Net_Library_Usage]Net Library Usage[/url] in another thread. I didn't bother to read the rest of your code or your post because, again, my eyes hurt.
[IMG]http://i.imgur.com/KfF2nSb.jpg[/IMG]
[QUOTE=Smuggest;51228791][IMG]http://i.imgur.com/KfF2nSb.jpg[/IMG][/QUOTE] Now thats much better, I understand OP's problem now, and my eyes stopped hurting, thanks very much!
Sorry, you need to Log In to post a reply to this thread.