ace43609 Posted February 17, 2015 Share Posted February 17, 2015 I am trying to give my character special abilities only when they are unarmed (nothing equipped)I have no idea how to specifically make it work though.I have the ability working normally (among other restrictions to it like a sanity minimum) just need it to ONLY work with nothing in-hand. I was thinking something along the lines of- If not (whatever goes here that involves having something equipped) then DisableHunt(inst) return end I'm still kind of new at this stuff so any advice or tips are helpful and greatly appreciated. Link to comment https://forums.kleientertainment.com/forums/topic/51094-help-how-to-make-something-unarmed-specific/ Share on other sites More sharing options...
Mobbstar Posted February 17, 2015 Share Posted February 17, 2015 (edited) If you check for inst.components.inventory.equipslots[EQUIPSLOTS.HANDS] it should work (BODY and HEAD work for the respective slots). So you'd have something like this: local function Update(inst) If inst.components.inventory.equipslots[EQUIPSLOTS.HANDS] then EnableHunt(inst) else DisableHunt(inst) endend The concept you posted above (besides requiring a condition) needs to be checked regularly. Whilst there is a way to do that EDIT:regularly, you should rather try to use the event system. All you need to do in your case is to write the following two lines (in the part where "special powers" belong to): inst:ListenForEvent("onequip",Update)inst:ListenForEvent("onunequip",Update) Edited February 17, 2015 by Mobbstar Link to comment https://forums.kleientertainment.com/forums/topic/51094-help-how-to-make-something-unarmed-specific/#findComment-613994 Share on other sites More sharing options...
ace43609 Posted February 17, 2015 Author Share Posted February 17, 2015 (edited) Thank you so much, you are a beautiful person!The thing I am trying to implement is a sanity based (because I am not experienced enough to make a meter for it) "invisibility" with a crit on out-of-stealth hits.And I want the character's focus to be around combat using its "claws" and not any other weapons so you really helped a ton.Thanks again, beautiful stranger! Edited February 17, 2015 by ace43609 Link to comment https://forums.kleientertainment.com/forums/topic/51094-help-how-to-make-something-unarmed-specific/#findComment-613997 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