. . . Posted February 3, 2022 Share Posted February 3, 2022 I find it too cheaty and want to use a mod which disables it, does anybody know a way on how to do it? Link to comment https://forums.kleientertainment.com/forums/topic/137292-how-to-disable-player-auto-equipping-armortoolweapon-when-it-breaks/ Share on other sites More sharing options...
Monti18 Posted February 4, 2022 Share Posted February 4, 2022 I can tell you where you can find them, I don't know how to change them except for using the upvaluehacker as I don't know if the functions can be accessed otherwise. Spoiler function fns.OnItemRanOut(inst, data) if inst.components.inventory:GetEquippedItem(data.equipslot) == nil then local sameTool = inst.components.inventory:FindItem(function(item) return item.prefab == data.prefab and item.components.equippable ~= nil and item.components.equippable.equipslot == data.equipslot end) if sameTool ~= nil then inst.components.inventory:Equip(sameTool) end end end function fns.OnUmbrellaRanOut(inst, data) if inst.components.inventory:GetEquippedItem(data.equipslot) == nil then local sameTool = inst.components.inventory:FindItem(function(item) return item:HasTag("umbrella") and item.components.equippable ~= nil and item.components.equippable.equipslot == data.equipslot end) if sameTool ~= nil then inst.components.inventory:Equip(sameTool) end end end function fns.ArmorBroke(inst, data) if data.armor ~= nil then local sameArmor = inst.components.inventory:FindItem(function(item) return item.prefab == data.armor.prefab end) if sameArmor ~= nil then inst.components.inventory:Equip(sameArmor) end end end -------------------- local function RegisterMasterEventListeners(inst) inst:ListenForEvent("itemranout", fns.OnItemRanOut) inst:ListenForEvent("umbrellaranout", fns.OnUmbrellaRanOut) inst:ListenForEvent("armorbroke", fns.ArmorBroke) in player_common.lua 2 Link to comment https://forums.kleientertainment.com/forums/topic/137292-how-to-disable-player-auto-equipping-armortoolweapon-when-it-breaks/#findComment-1537956 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