Pudge Posted May 13, 2017 Share Posted May 13, 2017 (edited) greetings everyone i'd like to know if there is a way to increase or reduce the body weight of the character when he eats something like a banana? somethink like.... function Itemcool() if getPlayer():HasBodyWeight() > 10 then -- Does something like this even exists -> HasBodyweight? SetBodyWeight? or getBodyWeight ? getPlayer():SetBodyWeight = ( getPlayer():getBodyWeight - 5 ) -- i really have troubles understanding that :I end end thanks again for reading, and sorry for my bad english. SOLVED: (Thanks to Sky_Orc_Mm) Quote function Itemcool() local pwg = getPlayer():getNutrition():getWeight(); if pwg >= 40 then getPlayer():getNutrition():setWeight(pwg - 5) end end Edited May 14, 2017 by Pudge Solved Link to comment Share on other sites More sharing options...
Damien Darkside Posted May 13, 2017 Share Posted May 13, 2017 If you have "nutrition" on, you will gain or lose weight based on positive or negative calorie counts. I stick it near 80, which is default if you have nutrition off. Pudge 1 Link to comment Share on other sites More sharing options...
ProjectSky Posted May 13, 2017 Share Posted May 13, 2017 Try this: function Itemcool(self) local pwg = self.getNutrition():getWeight() if pwg >= 40 then --Weight value: Min 35, Max inf. self.getNutrition():setWeight(pwg - 5) end end Pudge 1 Link to comment Share on other sites More sharing options...
Pudge Posted May 14, 2017 Author Share Posted May 14, 2017 thanks Sky_Orc_Mm you are a rockstar 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