Level up during combat

Hey,

I've been trying to search for a while and I can't find a solution so might as well try asking here.

Is there a script or a battle system to get my characters to be able to level up while the battle is still going? Like whenever my party kills an enemy they gain experience and this experience is granted straight away, and it can get the party members to level up (and then possibly heal up), even if there are still other enemies left and the battle hasn't ended.

I'd also like items to drop straight after killing an enemy. For example an enemy has a potion in the drop list, and as soon as the enemy is killed the party gets the potion and is able to use it.

Is there a way to do any of this? Any scripts that I haven't been able to find, or even evented work arounds?
Make a Battle Event on "Troops" with the condition "Enemy [1. name]'s HP 0% or below" and "Span" Battle.

Use a Scrip Call and paste this code:

$game_variables[1] = $game_troop.members[0].exp$game_party.gain_gold($game_troop.members[0].gold)text = sprintf(Vocab:😮btainExp, $game_variables[1]) $game_message.add('\.' + text)text = sprintf(Vocab:😮btainGold, $game_troop.members[0].gold, Vocab::currency_unit) $game_message.add('\.' + text)$game_party.all_members.each do |actor| actor.gain_exp($game_variables[1])end$game_troop.make_drop_items.each do |item| $game_party.gain_item(item, 1) $game_message.add(sprintf(Vocab:😮btainItem, item.name))endMake a new event page like this one for every other enemy in the troop. Remember to change the "$game_troop.members[0]" for other enemies (0 for the first enemy, 1 is the second and so on).I'm using the variable 1 here, change "$game_variables[1]" to the variable you want.

Ah, on "BattleManager" Script (F11), change this:

def self.process_victory play_battle_end_me replay_bgm_and_bgs $game_message.add(sprintf(Vocab::Victory, $game_party.name)) display_exp gain_gold gain_drop_items gain_exp SceneManager.return battle_end(0) return true endto this:
Code:
  def self.process_victory    play_battle_end_me    replay_bgm_and_bgs    $game_message.add(sprintf(Vocab::Victory, $game_party.name))    wait_for_message    SceneManager.return    battle_end(0)    return true  end
 You'll have to copy this Battle Event for every Troop. Yeah, not the easiest way, but it works =)
Hey, thank you for the help! But I can't get it to work.

First I couldn't paste that whole code to the script call box, then I thought I'd need Tsukihime's large script call script. But now I'm getting this error: http://i.imgur.com/hVD97mS.png
Are you using the lite version? You can divide it in several parts, just keep those together:
 

Spoiler
text = sprintf(Vocab::ObtainExp, $game_variables[1])
$game_message.add('\.' + text)

Spoiler
text = sprintf(Vocab::ObtainGold, $game_troop.members[0].gold, Vocab::currency_unit)
$game_message.add('\.' + text)

Spoiler
$game_party.all_members.each do |actor|
actor.gain_exp($game_variables[1])
end

Spoiler
$game_troop.make_drop_items.each do |item|
$game_party.gain_item(item, 1)
$game_message.add(sprintf(Vocab::ObtainItem, item.name))
end
Ah, I see. No I'm not using lite. I'm still getting errors though.

"unexpected tlBRAK, expecting ')' [0].gold)And if I remove this completely

$game_party.gain_gold($game_troop.members[0].gold)I get a different error:

Code:
undefined method `exp' for [0]:Array
You cant break the lines, for example, if you write your code like this:

$game_party.gain_gold($game_troop.members[0].gold)instead of this:

$game_party.gain_gold($game_troop.members[0].gold)you'll get that error.

If it doesn't fit your script call box i can only suggest you to update your RPG Maker, if you don't have an original copy than i can't help you at all 
Thank you so much! It works now, I have the version I bought from steam. I don't know if that makes it different but it really didn't fit all. I had to break it up like this:

$game_variables[1] =
$game_troop.members[0].exp

Original thread: https://forums.rpgmakerweb.com/threads/level-up-during-combat.40735/