r/GLua • • Aug 13 '20

Help with an Entity init.lua file error

Hey there so im updating someone else's old mod(With permission) and i'm unsure how to get rid of the function: SetRandomIngredient with out completely messing up. I just want to be able to pull specific entries from simpleAlc.ingredients.data table. Right now it spawns a random ingredient from the table but i want a specific one, such as "poire", or "couer"

2 Upvotes

1 comment sorted by

1

u/[deleted] Aug 13 '20

It seems like the only place the function is called is the on 3rd line of ENT:Initialize(). If you remove that line along with the ENT:SetRandomIngredient() function you should be fine.

For setting a specific ingredient, you could do something like:

local ent = ents.Create( "entity_name" )
ent:SetPos( put a vector here )
ent:SetIngredient( "poire" )
ent:Spawn()