When the player collects more than enough XP for a level, they will go up hundreds of levels at a time.
When “Trigger once” is used as a condition, the player will only ever gain 2 levels.
When the player levels up, they are shown a menu where they can upgrade a player Stat. I would like to show a button (where they can select the player Stat) The name of the stat, and the current value of the stat.
As my code is right now, when it runs I am expecting it to show the Name of the randomly selected player stats, however it is just showing the value 0.
The Official tutorial never goes this far, and didn’t have this issue, and I’ve not been able to find any soloutions.
You meant roguelike game?
These are different variables. The first 3 are global while the 2nd group seem to be object.
If the 2nd group are arrays then maybe you want to use
Player.LevelUpVariables[optOne] without ToString () if it’s text. Repeat it with the other variable names.
Are the 2nd group arrays or structures.
Variable names is fixed. (Thank you Keith!!)
If I am understanding you correctly, yes the “Player.LevelUpVariables” is an array, I have another array which holds the Values of the Variables? So LevelUpVariables[0] = Bullet Damage and LevelUpValues[0] = 21. They are both local variables attatched to the player.
1 Like
I’m not sure why you would want to subtract the XP needed from your CurrentXP. Instead you should be changing XPForLevel to the next threshold.
Let’s say CurrentXP = 1200 and XPForLevel = 1000. The event will trigger, now change XPForLevel to a higher number such as 2000. This should prevent the event from triggering again (unless the player managed to get 2 or more levels worth of xp)
I tried to subtract the XP from the current amount to account for the player collecting overflow XP. The XPForLevel should be increasing by 1.3x when the level is received; while writing this I realised that the code is setting the XPForLevel to 1.3, instead of multiplying it by 1.3.
Haha, that’ll do it…
What’s wrong with overflow? I think most players would expect it…
I didn’t say there was anything wrong with overflow? I’m using it?
Ah, my bad, I just read your post wrong 