MV Learn skill by ID

Hello.
Is there a way to learn a skill by ID?

I don't want to use the "learn skill" command because it limits me to assigning the player a specific skill.

I want to learn a skill randomly, passing it a random parameter (number) for example from 1 to 50.

If the program randomly picks 5, then the player will learn skill number 5.

Everything to avoid placing 50 conditional if, thanks.
Nope, you have to make 50 conditional branches. Javascript just isn't powerful enough to do things with variables. 😉

Joking aside:

$gameActors.actor(1).learnSkill(Math.randomInt(50) + 1);

Will teach actor 1 a random skill from 1 to 50.
Nope, you have to make 50 conditional branches. Javascript just isn't powerful enough to do things with variables. 😉

Joking aside:

$gameActors.actor(1).learnSkill(Math.randomInt(50) + 1);

Will teach actor 1 a random skill from 1 to 50.

thanks! 😀

Original thread: https://forums.rpgmakerweb.com/threads/learn-skill-by-id.154972/