ok. say i have 2 dynamic boxes one named “experience” and the other “lvl”. how would i make it so that when experience is greater or equal to 1000, lvl goes + 1 i tried this but it doesn’t seem to work. Any suggestions?
You should have _global.variables instead, or at least variables, and update the experience and level textbox every second or so using these. This way you can access the variables, not just the textboxes.
You’d get:
if( exp >= (_root[“level”+(current_level+1)+"_requisite"]) ) {
current_level +=1;
} [size=1]What this syntax does is check for variables with a nomenclature as described after the following paragraph…[/size]
–>Where exp is the current variable which holds the total experience points gained and current_level the variable which holds what level the player is actually at.
Nomenclature:
You could define level_prerequisites (that variable name is too long but you get the idea) for levels as much as 1 to 100…
If you know how to use them, it would be easier to stock the levels and their prerequisited exp points in an array, this array made global just for sheer usability (in items which require player to be level 35, you need to check the current level; in a status screen which shows how much more exp you need to get to the next level, you take the one after the current level and you substract the xp for next level with the current and you see how much more xp you need…etc)
I’m not gonna explain here on how to use arrays, look around the kirupa tutorials for more info Hope this helped.