HeilerderWelten Posted August 28, 2015 Share Posted August 28, 2015 (edited) Hi guys and ladys. The problem is as followed, I want for my Guts Mod the drawback, that he can´t wear any helmets and hats, besides his mod helmet, the Berserker Helmet. I have found this in the Dr. Nefarious Mod:(in the modmain.lua) local function ModHat(inst) if GLOBAL.ThePlayer().prefab == "nefarious" then inst:RemoveComponent("equippable")endendAddPrefabPostInit('strawhat', ModHat)AddPrefabPostInit('winterhat', ModHat)AddPrefabPostInit('beefalohat', ModHat)AddPrefabPostInit('tophat', ModHat)AddPrefabPostInit('beehat', ModHat)AddPrefabPostInit('minerhat', ModHat)AddPrefabPostInit('spiderhat', ModHat)AddPrefabPostInit('footballhat', ModHat)AddPrefabPostInit('earmuffshat', ModHat)AddPrefabPostInit('bushhat', ModHat)AddPrefabPostInit('walrushat', ModHat)AddPrefabPostInit('slurtlehat', ModHat)AddPrefabPostInit('ruinshat', ModHat)AddPrefabPostInit('armorgrass', ModHat)AddPrefabPostInit('armorwood', ModHat)AddPrefabPostInit('armormarble', ModHat)AddPrefabPostInit('armor_sanity', ModHat)AddPrefabPostInit('ghelmet', ModHat)AddPrefabPostInit('bhelmet', ModHat)AddPrefabPostInit('rhelmet', ModHat)AddPrefabPostInit('barmor', ModHat)AddPrefabPostInit('rarmor', ModHat) it does exactly what I need, but it doesn´t work, maybe because it is coded only for DS/ROG. If I build a strawhat with DR Nefarious (DST) the game will crash, so it must be the code. Can you help me? (and in that case also the DR. Nefarious Mod creator)Or is it not possible for DST? This is my Guts Mod:http://steamcommunity.com/sharedfiles/filedetails/?id=493284025&searchtext=gutsAnd this is Dr. Nefarious:http://steamcommunity.com/sharedfiles/filedetails/?id=503469674&searchtext=ratchet Edited August 28, 2015 by HeilerderWelten Link to comment Share on other sites More sharing options...
DarkXero Posted August 28, 2015 Share Posted August 28, 2015 @HeilerderWelten: local _Equip = 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.HEAD then if not (item.prefab == "berserkerhelmet") then self:DropItem(item) self:GiveItem(item) return end end return _Equip(self, item, old_to_active) endin the master_postinit. Link to comment Share on other sites More sharing options...
HeilerderWelten Posted August 28, 2015 Author Share Posted August 28, 2015 I thank you very much Xero, I will test it and hope that it will work. You are really awsome, probably the most helpful person in the forum, thanks. Link to comment Share on other sites More sharing options...
HeilerderWelten Posted August 28, 2015 Author Share Posted August 28, 2015 IT WORKS!!! I love you DarkXero, in the manliest way that you can imagine! Link to comment Share on other sites More sharing options...
HeilerderWelten Posted August 30, 2015 Author Share Posted August 30, 2015 @HeilerderWelten: local _Equip = 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.HEAD then if not (item.prefab == "berserkerhelmet") then self:DropItem(item) self:GiveItem(item) return end end return _Equip(self, item, old_to_active) endin the master_postinit. Thank you very much DarkXero for all your help, Guts is now better than I ever could imagined.You are really an awsome person and helpul like a lighter in the dark.. Link to comment 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