Jump to content

Automatically un-equip headgear?


Recommended Posts

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? 

20190803012803_1.jpg

20190803012806_1.jpg

20190803012759_1.jpg

Link to comment
Share on other sites

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
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...