Scrumch Posted August 3, 2019 Share Posted August 3, 2019 After the last post, I'm pretty much done. My character can now switch between 'hood-up' and 'hood-down' forms, and not be able to wear hats while in 'hood-up' (I even added a voice line!). Though you can still wear both a headgear item and the hood by equipping the headgear item first before pressing the hood up key. What would I need to add to un-equip any headgear currently worn when the key is pressed? Link to comment https://forums.kleientertainment.com/forums/topic/109930-automatically-un-equip-headgear/ Share on other sites More sharing options...
zetake Posted August 3, 2019 Share Posted August 3, 2019 Well, I don't know, but I looked into the game code, and this should work. local player = GetPlayer() local headitem = player.components.inventory:GetEquippedItem(EQUIPSLOTS.HEAD) if headitem then player.components.inventory:Unequip(EQUIPSLOTS.HEAD) end Link to comment https://forums.kleientertainment.com/forums/topic/109930-automatically-un-equip-headgear/#findComment-1238538 Share on other sites More sharing options...
Scrumch Posted August 4, 2019 Author Share Posted August 4, 2019 I had to add some code to return the worn hat, but aside from that, it did the trick! Thanks! Link to comment https://forums.kleientertainment.com/forums/topic/109930-automatically-un-equip-headgear/#findComment-1238967 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