Rectal Express Posted January 1, 2019 Share Posted January 1, 2019 (edited) 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 January 1, 2019 by Rectal Express Link to comment https://forums.kleientertainment.com/forums/topic/101316-how-to-reference-a-specific-item/ Share on other sites More sharing options...
MidrealmDM Posted January 20, 2019 Share Posted January 20, 2019 try it without quotes return inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HEAD) == tophat Link to comment https://forums.kleientertainment.com/forums/topic/101316-how-to-reference-a-specific-item/#findComment-1145036 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now