Jump to content

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"
end

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!

Edited by Rectal Express

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...