Jump to content

(SOLVED) Lose or gain body weight


Pudge

Recommended Posts

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 by Pudge
Solved
Link to comment
Share on other sites

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

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...