neb3213 Posted June 25, 2022 Share Posted June 25, 2022 I want to check if my character wears specific item. Link to comment https://forums.kleientertainment.com/forums/topic/141215-how-do-i-check-what-my-character-wears/ Share on other sites More sharing options...
neb3213 Posted June 26, 2022 Author Share Posted June 26, 2022 Sorry, I meant in code, like I want one function to happen if my character wears specific hat. Link to comment https://forums.kleientertainment.com/forums/topic/141215-how-do-i-check-what-my-character-wears/#findComment-1579833 Share on other sites More sharing options...
-LukaS- Posted June 26, 2022 Share Posted June 26, 2022 inst.components.inventory:IsItemEquipped(item_prefab) returns true if item_prefab is equipped in any slot. Link to comment https://forums.kleientertainment.com/forums/topic/141215-how-do-i-check-what-my-character-wears/#findComment-1579908 Share on other sites More sharing options...
neb3213 Posted June 27, 2022 Author Share Posted June 27, 2022 if inst.components.inventory:IsItemEquipped("hat_bee_bw") then print("--=--") else print("====") end Yeah, it doesn't really work Link to comment https://forums.kleientertainment.com/forums/topic/141215-how-do-i-check-what-my-character-wears/#findComment-1580027 Share on other sites More sharing options...
-LukaS- Posted June 27, 2022 Share Posted June 27, 2022 Does the game crash or just not print the correct string? Link to comment https://forums.kleientertainment.com/forums/topic/141215-how-do-i-check-what-my-character-wears/#findComment-1580035 Share on other sites More sharing options...
neb3213 Posted June 28, 2022 Author Share Posted June 28, 2022 It doesn't print the right string, it's always "====" Link to comment https://forums.kleientertainment.com/forums/topic/141215-how-do-i-check-what-my-character-wears/#findComment-1580137 Share on other sites More sharing options...
-LukaS- Posted June 28, 2022 Share Posted June 28, 2022 Hmm... Alternatively you could use inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HEAD) to see if your item is equipped. Link to comment https://forums.kleientertainment.com/forums/topic/141215-how-do-i-check-what-my-character-wears/#findComment-1580172 Share on other sites More sharing options...
neb3213 Posted June 30, 2022 Author Share Posted June 30, 2022 Well, it does work, but it works on every hat Is there function to check helmet tag on a character ? Link to comment https://forums.kleientertainment.com/forums/topic/141215-how-do-i-check-what-my-character-wears/#findComment-1580723 Share on other sites More sharing options...
neb3213 Posted June 30, 2022 Author Share Posted June 30, 2022 I found solution, inst.components.inventory:EquipHasTag() Link to comment https://forums.kleientertainment.com/forums/topic/141215-how-do-i-check-what-my-character-wears/#findComment-1580726 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