Jump to content

How to reference a specific item

Recommended Posts

I am trying to make pigs chop trees if they are given the tophat. I have been trying things within the pigbrain.lua:

local function StartChoppingCondition(inst)
    return inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HEAD) == "tophat"

However, it does not regconize "tophat". It does work if I put "nil" as the value, the pigs will chop trees whenever they DONT have equipped hat.

I am quite sure it is the problem of my reference to the tophat. Any ideas? Thanks!

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

  • Create New...