Eremus007 Posted May 29, 2016 Share Posted May 29, 2016 Hey, I had an idea for a newspaper weapon mod I am developing. I would like that if the weapon is wet (like with the blue bar around the item comes) that it loses durability more quickly (because paper breaks when it's wet. But I really have no idea how to call a function like that or say that in LUA. Is that even possible? Link to comment https://forums.kleientertainment.com/forums/topic/67742-help-with-an-interesting-script/ Share on other sites More sharing options...
Aquaterion Posted May 29, 2016 Share Posted May 29, 2016 (edited) i think you can do something like; --on attack function if inst.components.moisture and inst.components.moisture:IsWet() and inst.components.finiteuses then inst.components.finiteuses:Use(1) -- uses 1 plus the normal use(which should be 1 too) end im not sure if that works for inventory items, so i'll give you this version as well --on attack function if inst.components.inventoryitemmoisture and inst.components.inventoryitemmoisture.iswet and inst.components.finiteuses then inst.components.finiteuses:Use(1) -- uses 1 plus the normal use(which should be 1 too) end btw.. why do you always name your thread "unique" or "interesting" xD Edited May 29, 2016 by Aquaterion Link to comment https://forums.kleientertainment.com/forums/topic/67742-help-with-an-interesting-script/#findComment-777880 Share on other sites More sharing options...
DarkXero Posted May 29, 2016 Share Posted May 29, 2016 if inst:GetIsWet() then inst.components.finiteuses:Use(1) end Covers both moisture and inventoryitemmoisture. Link to comment https://forums.kleientertainment.com/forums/topic/67742-help-with-an-interesting-script/#findComment-777882 Share on other sites More sharing options...
Eremus007 Posted May 29, 2016 Author Share Posted May 29, 2016 (edited) 23 minutes ago, Aquaterion said: i think you can do something like; --on attack function if inst.components.moisture and inst.components.moisture:IsWet() and inst.components.finiteuses then inst.components.finiteuses:Use(1) -- uses 1 plus the normal use(which should be 1 too) end im not sure if that works for inventory items, so i'll give you this version as well --on attack function if inst.components.inventoryitemmoisture and inst.components.inventoryitemmoisture.iswet and inst.components.finiteuses then inst.components.finiteuses:Use(1) -- uses 1 plus the normal use(which should be 1 too) end btw.. why do you always name your thread "unique" or "interesting" xD Thanks to you both! I will try that! And I only name them unique or interesting so someone will help me faster if I am really honest. XD And to DarkXero you are a REALLY awesome guy. You've helped me and other new/small modders so much in the past. I just thought someone should say that Edited May 29, 2016 by Eremus007 Link to comment https://forums.kleientertainment.com/forums/topic/67742-help-with-an-interesting-script/#findComment-777887 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