Item recieved on level up?

I am trying to make so that when the player levels up they receive an item which is used for a skill web. Is there anyway to do this either with or without plug-ins? Thanks a bunch.
Without plugin, you'll want to use a Parallel Process Common Event, that compares the player's current level with a "previous level" variable. That variable must be initialized with the player's level at the beginning of the game, and set to the player's current level whenever the level changes (to avoid granting an infinite amount of rewards to the player).

Since it's a Parallel Process Common Event, it'll be running all the time, which may affect your game's performance. As long as you don't have too many of those, that's not a problem.

But if you want to avoid wasting CPU cycles checking the player's level all the time, you can use the following plugin:
JavaScript:
/*:
 * @target MZ
 * @plugindesc Calls a Common Event on level up.
 *
 * @param commonEventId
 * @text Common Event
 * @desc The Common Event to call on level up.
 * @type common_event
 * @default 0
 *
 * @param actorIdVariableId
 * @text Actor ID variable
 * @desc The variable in which to store the ID of the actor that just levelled up.
 * @type variable
 * @default 0
 */

(() => {
    const PLUGIN_NAME = "OnLevelUp";

    const parameters = PluginManager.parameters(PLUGIN_NAME);
    parameters.commonEventId = Number(parameters.commonEventId);
    parameters.actorIdVariableId = Number(parameters.actorIdVariableId);

    const Game_Actor_levelUp = Game_Actor.prototype.levelUp;
    Game_Actor.prototype.levelUp = function() {
        Game_Actor_levelUp.call(this);

        $gameVariables.setValue(parameters.actorIdVariableId, this.actorId());
        $gameTemp.reserveCommonEvent(parameters.commonEventId);
    }
})();
Basically, this plugin will call a Common Event as soon as an actor (any actor) levels up.
Your Common Event must check for the player's level to determine which reward to give.

NOTES:
  • This plugin does not check for level down events, so if your player can lose experience and/or level down, they can theoretically receive the same reward more than once, unless you keep track of which rewards were already given.
  • You can check which actor levelled up, by using the "Actor ID variable", in which the actor's ID will be stored. Use this to decide which reward to give (if any) based on which actor gained a level.
  • I did not test this plugin, but am relatively confident that it should work. If not, I'll fix it.
To use this plugin, simply paste the code into a file called: OnLevelUp.js and put the file in your project's /js/plugins folder.
If you want to use a different name for that file, make sure the PLUGIN_NAME = "OnLevelUp"; matches the file name (without the .js part). This is important because the plugin needs to know its own file name to fetch its own parameters (in this case, the ID of the Common Event it must call).

There are no terms of usage for this particular plugin. Use it however you like.
Without plugin, you'll want to use a Parallel Process Common Event, that compares the player's current level with a "previous level" variable. That variable must be initialized with the player's level at the beginning of the game, and set to the player's current level whenever the level changes (to avoid granting an infinite amount of rewards to the player).

Since it's a Parallel Process Common Event, it'll be running all the time, which may affect your game's performance. As long as you don't have too many of those, that's not a problem.

But if you want to avoid wasting CPU cycles checking the player's level all the time, you can use the following plugin:
JavaScript:
/*:
 * @target MZ
 * @plugindesc Calls a Common Event on level up.
 *
 * @param commonEventId
 * @text Common Event
 * @desc The Common Event to call on level up.
 * @type common_event
 * @default 0
 *
 * @param actorIdVariableId
 * @text Actor ID variable
 * @desc The variable in which to store the ID of the actor that just levelled up.
 * @type variable
 * @default 0
 */

(() => {
    const PLUGIN_NAME = "OnLevelUp";

    const parameters = PluginManager.parameters(PLUGIN_NAME);
    parameters.commonEventId = Number(parameters.commonEventId);
    parameters.actorIdVariableId = Number(parameters.actorIdVariableId);

    const Game_Actor_levelUp = Game_Actor.prototype.levelUp;
    Game_Actor.prototype.levelUp = function() {
        Game_Actor_levelUp.call(this);

        $gameVariables.setValue(parameters.actorIdVariableId, this.actorId());
        $gameTemp.reserveCommonEvent(parameters.commonEventId);
    }
})();
Basically, this plugin will call a Common Event as soon as an actor (any actor) levels up.
Your Common Event must check for the player's level to determine which reward to give.

NOTES:
  • This plugin does not check for level down events, so if your player can lose experience and/or level down, they can theoretically receive the same reward more than once, unless you keep track of which rewards were already given.
  • You can check which actor levelled up, by using the "Actor ID variable", in which the actor's ID will be stored. Use this to decide which reward to give (if any) based on which actor gained a level.
  • I did not test this plugin, but am relatively confident that it should work. If not, I'll fix it.
To use this plugin, simply paste the code into a file called: OnLevelUp.js and put the file in your project's /js/plugins folder.
If you want to use a different name for that file, make sure the PLUGIN_NAME = "OnLevelUp"; matches the file name (without the .js part). This is important because the plugin needs to know its own file name to fetch its own parameters (in this case, the ID of the Common Event it must call).

There are no terms of usage for this particular plugin. Use it however you like.
this is great! thanks a bunch!
Since it's a Parallel Process Common Event, it'll be running all the time, which may affect your game's performance. As long as you don't have too many of those, that's not a problem.
The solution to this is simply to have a Wait at the very start of the parallel process event. You don't really need to check 60 times a second, for the entire game, whether an actor has levelled up.

Original thread: https://forums.rpgmakerweb.com/threads/item-recieved-on-level-up.138690/