Attributes
metalmario991
13 Mar 2014, 21:07I am trying to increase my characters strength attribute but I don't know how to do so without getting a error. Can someone help?

jaynabonne
13 Mar 2014, 23:15As an example, if the player object has a "strength" attribute of type int, then you can add 10 to it by doing:
If that doesn't help, then you're going to need to get more specific about what you want to do and what you tried. A good start would be to show the code you've had problems with.
player.strength = player.strength + 10
If that doesn't help, then you're going to need to get more specific about what you want to do and what you tried. A good start would be to show the code you've had problems with.
HegemonKhan
14 Mar 2014, 00:43in the GUI (this is how you do Jay's code line via the GUI):
Run as script -> add a script -> Variables -> Set a variable or attribute ->
left of equal sign: game.pov.strength
right of equal sign: game.pov.strength + your_number_amount
for example:
game.pov.strength = game.pov.strength + 10
~OR~
Run as script -> add a script -> Variables -> Set a variable or attribute ->
left of equal sign: player.strength
right of equal sign: player.strength + your_number_amount
for example:
player.strength = player.strength + 10
Run as script -> add a script -> Variables -> Set a variable or attribute ->
left of equal sign: game.pov.strength
right of equal sign: game.pov.strength + your_number_amount
for example:
game.pov.strength = game.pov.strength + 10
~OR~
Run as script -> add a script -> Variables -> Set a variable or attribute ->
left of equal sign: player.strength
right of equal sign: player.strength + your_number_amount
for example:
player.strength = player.strength + 10