kavaline Posted October 29, 2016 Share Posted October 29, 2016 I need compare if the item in my EQUIPSLOTS.HANDS have a action/ability of chop trees, but have no idea in where i find this comparison. I need this result based on the item equipped, returning TRUE or FALSE. Anyone know how do it, or where I find the answer? Link to comment https://forums.kleientertainment.com/forums/topic/71225-help-how-get-the-setaction-in-hand-slot/ Share on other sites More sharing options...
kavaline Posted October 29, 2016 Author Share Posted October 29, 2016 (edited) Well, if someone need, I found: if item.components.tool:CanDoAction(ACTIONS.CHOP) then end But this don't work inside the Brains. I want an option for a mob chop a tree, if he have an item that can CHOP (axe, gold axe, pick/axe) equiped in your hand. But i can't compare it, I don't know how get. In Brain, OnStart: IfNode(function() return self.inst.prefab == "pig" end, "Keep Chopping", DoAction(self.inst, function() return GoChop(self.inst, ACTIONS.CHOP) end)), I want change self.inst.prefab == "pig" for this comparison, or do it inside of my local function GoChop. But I can't get the item in EQUIPSLOTS.HANDS. @Edit This "Keep Chopping", what is? Where I use or send this, what means, or any information about it? '-' Edited October 29, 2016 by kavaline Link to comment https://forums.kleientertainment.com/forums/topic/71225-help-how-get-the-setaction-in-hand-slot/#findComment-830678 Share on other sites More sharing options...
Leonardo Cox Posted October 30, 2016 Share Posted October 30, 2016 I'm not 100% sure what you're wanting here but if you want it to read whats in your handslot then heres this: local handslot = inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HANDS) or nil if handslot ~= nil and handslot.components.tool ~= nil and handslot.components.tool:CanDoAction(ACTIONS.CHOP) then end Link to comment https://forums.kleientertainment.com/forums/topic/71225-help-how-get-the-setaction-in-hand-slot/#findComment-831019 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