Attributes

metalmario991
I 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
As an example, if the player object has a "strength" attribute of type int, then you can add 10 to it by doing:

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
in 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

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums