How to random stats?

So I want to make a common event that will grant a total of 100 random stats from atk, def, m.def, m.atk, luck and agility.
So it will randomly give any number of stats from those 6 until it reaches an accumulated total of 100.
I know I have to tie a variable to each stat but apart from that I'm lost.
Not sure how to go about the rest to make sure it doesn't go over the sum total of 100 or even go about getting it to be random.

Anyone have any idea?
You just need to count, make 'isItAHundredAlready?' var or something like that.
When you randomly add 3 ATK stat, add 3 to the var.
When you randomly add 5 LUK stat, add 5 to the var.
And so on.
Then do a conditional branch the var if isItAHundredAlready? >= 100.

Voila!
You just need to count, make 'isItAHundredAlready?' var or something like that.
When you randomly add 3 ATK stat, add 3 to the var.
When you randomly add 5 LUK stat, add 5 to the var.
And so on.
Then do a conditional branch the var if isItAHundredAlready? >= 100.

Voila!
Would using a range for variables that have that, work doing random? Since var 1-6 are my stats.
Hmm, it should work fine, add var 1 to 6, check if the sum of it all is 100, then you can stop adding more stats to them. No more need a new variable to count.
Okay thanks. I'll give it a shot n see if I can set it up properly lol if not I'll be back

Original thread: https://forums.rpgmakerweb.com/threads/how-to-random-stats.125427/