Capt.Muller Posted February 2, 2020 Share Posted February 2, 2020 Here's my issue. I'm currently making custom characters for my wife and I as we love playing this game together. I've based her character off wheeler as she has the dodge function, I've got everything how I want it except I want her character and only her character to get more use out of sewing kits, I pinched the attached from another mod and threw it in her characters "modmain.lua" and it works perfectly except for the fact it gives anyone in the server the same upgraded repair ability If anyone could help me with getting this to work exclusively for her it would be greatly appreciated, Thanks in advance. local function DoSewing(self, target, doer) if target:HasTag("needssewing") then target.components.fueled:SetPercent(1) if self.inst.components.finiteuses then self.inst.components.finiteuses:Use(0.05) end if self.onsewn then self.onsewn(self.inst, target, doer) end return true end end local function SewingPostInit(self) if not GLOBAL.TheWorld.ismastersim then return end self.DoSewing = DoSewing end AddComponentPostInit("sewing", SewingPostInit) Link to comment https://forums.kleientertainment.com/forums/topic/115431-help-i-need-help-coding-a-longer-lasting-sewing-kit/ Share on other sites More sharing options...
Yakuzashi Posted February 7, 2020 Share Posted February 7, 2020 Hi. I see this post is about week old and nobody bothered to answer your call for help. So here I am. Try to modify the first function just like that: local function DoSewing(inst, self, target, doer) if target:HasTag("needssewing") and inst:HasTag("tailor") then target.components.fueled:SetPercent(1) if self.inst.components.finiteuses then self.inst.components.finiteuses:Use(0.05) end if self.onsewn then self.onsewn(self.inst, target, doer) end return true end end This part Quote inst:HasTag("tailor") requires you to add tag "tailor" or whatever you like into [character's.name].lua local common_postinit = function(inst) inst:AddTag("tailor") end I think it should work now, but I am not 100% sure. Testing this idea was quite time consuming. Link to comment https://forums.kleientertainment.com/forums/topic/115431-help-i-need-help-coding-a-longer-lasting-sewing-kit/#findComment-1305325 Share on other sites More sharing options...
Nophat Posted August 9, 2020 Share Posted August 9, 2020 Hi there, I was wondering how this worked out for you? I have been trying (for way to long) to do the exact same thing, but no success yet... Link to comment https://forums.kleientertainment.com/forums/topic/115431-help-i-need-help-coding-a-longer-lasting-sewing-kit/#findComment-1361403 Share on other sites More sharing options...
Yakuzashi Posted August 19, 2020 Share Posted August 19, 2020 Hi @Nophat you can send me your mod in .zip file and I will take a look. I had a very long hiatus from modding so bear in mind that it might take a while. Cheers! Link to comment https://forums.kleientertainment.com/forums/topic/115431-help-i-need-help-coding-a-longer-lasting-sewing-kit/#findComment-1363940 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