Hello !
I’m currently making a food system who will work with oven, pan, milk, flour and more element very realist but i’m stuck with a little problem.
I’have to register data to the pan like a counter of ingredients but it’s doesn’t work correctly.
When the entity pomme_de_terre touch the my entity, it’s add randomly 2, 3 or 4 to the counter.
My entity :
init.lua (a parts of)
function ENT:Touch( ent )
local obtenirconteur = self:Getcount()
if ent:GetClass() == "pomme_de_terre" then
ent:Remove()
self:Setcount( obtenirconteur + 1 )
self:Setpommedeterre( self:Getpommedeterre() + 1 )
print(self.count)
end
end
shared.lua
ENT.Type = "anim"
ENT.Base = "base_gmodentity"
ENT.PrintName = "Recipient"
ENT.Author = "IparazzHD"
ENT.Category = "IparazzDEV"
ENT.Spawnable = true
ENT.AdminSpawnable = true
function ENT:SetupDataTables()
self:NetworkVar( "Float", 0, "count" )
self:NetworkVar( "Float", 0, "pommedeterre" )
end
Sorry if my english is not correct, i’m french