kyupita Posted September 28, 2025 Share Posted September 28, 2025 How do I make it so that the only thing my character can equip (not including hand items) is his bag? I don't want him to be able to equip anything other than the bag (and heavy items such as the marble and moon altar pieces) in the body or hat slot I've looked through other posts and tried out the code they provided, and while it did block him from using body/hat items, it also didn't let him pick up his bag (even when trying to make an exception in the code), so I'm not too sure what's going on with it Link to comment https://forums.kleientertainment.com/forums/topic/168216-only-equip-bag/ Share on other sites More sharing options...
FerniFrenito Posted September 29, 2025 Share Posted September 29, 2025 -- in master_postinit of the character -- Can only equip his bag local OldEquip = inst.components.inventory.Equip inst.components.inventory.Equip = function(self, item, old_to_active) if not item or not item.components.equippable or not item:IsValid() then return end if (item.components.equippable.equipslot == EQUIPSLOTS.BODY and -- So that the prefab used in the body is only the one you want not (item.prefab == "prefab_name")) or item.components.equippable.equipslot == EQUIPSLOTS.HEAD -- so that nothing that goes on the head can be equipped then -- When the prefab is not what you need return -- we finished the function end return OldEquip(self, item, old_to_active) -- If the prefab is the one we are looking for, then we execute the function we overwrote to equip it end 1 Link to comment https://forums.kleientertainment.com/forums/topic/168216-only-equip-bag/#findComment-1837528 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