|Topic was automatically imported from the old Question2Answer platform.
I’m building a skill system and currently facing the following challenge:
I have skill1, skill2, skill3. The different skill levels are stored in a global script PlayerStats as values of the variables skill1_level, skill2_level, skill3_level.
When a point is assigned to a skill in my GUI script, I would like to update the level in the PlayerStats based on which skill got points assigned. Since the selected skill is already stored in a skill variable within my GUI script I would like to avoid going through all the if/elif/else nonsense to set the new level.
I have used something similar in the script to get the current level of the skill:
PlayerStats.get(skill + "_level")
But I’ve been unable to figure out how to set (or rather, +1) that value.