Fancy_Fox_Pers Posted December 18, 2015 Share Posted December 18, 2015 (edited) I took a look at @ZupaleX's Archery Mod to figure it out. My fuel should be papyrus. Here's what I've done (function names are often the same as in the Archery Mod for sake of simplicity and understanding) : -In my modmain : AddPrefabPostInit("papyrus", function (inst)inst:AddComponent("fuel") inst.components.fuel.fueltype = FUELTYPE.PENCILend) -In my prefab (swappable item) : local function MagicBowCanAcceptFuelItem(self, item)if item ~= nil and item.components.fuel ~= nil and (item.components.fuel.fueltype == FUELTYPE.PENCIL or item.prefab == "papyrus") thenreturn trueelsereturn falseendendlocal function MagicBowTakeFuel(self, item) if self:CanAcceptFuelItem(item) thenif item.prefab =="papyrus" thenself:DoDelta(25)end item:Remove() return true endend-In my prefab's main function (fn) : inst:AddComponent("fueled")inst.components.fueled.accepting = trueinst.components.fueled.fueltype = FUELTYPE.PENCILinst.components.fueled.maxfuel = 4inst.components.fueled:StopConsuming()inst.components.fueled.CanAcceptFuelItem = MagicBowCanAcceptFuelIteminst.components.fueled.TakeFuelItem = MagicBowTakeFuelinst:AddComponent("finiteuses")inst.components.finiteuses:SetMaxUses(TUNING.ORANGESTAFF_USES)So does anyone know what's missing/wrong? FYI : this is of course only the relevant code Currently the prefab has got for some reason 500% (all the time), even when using it. I have added the component "blinkstaff" to it. It doesn't lose durability after telepoofing for some reason Edited December 18, 2015 by Thibooms Link to comment Share on other sites More sharing options...
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 account
Already have an account? Sign in here.Sign In Now