0. In
Ruby indexes start at 0, not 1.
1. Yes, that internal value will get replaced automatically.
2. It looks for anybody in that specific position. The script doesn't know or care about previous swaps.
3. So everybody hates Basil now!?
Here's the updated script!
Please read the embedded comments.
They're worth it!

1. Yes, that internal value will get replaced automatically.

2. It looks for anybody in that specific position. The script doesn't know or care about previous swaps.

3. So everybody hates Basil now!?

Here's the updated script!

Please read the embedded comments.

Code:
# * Kuick Leader Swap XP * #
# Scripter : Kyonides
# v1.0.0 - 2025-09-06
# * Script Calls * #
# - Set a Temporary Leader!
# RememberLeaderIndex? stands for a boolean value: true or false.
# This new leader becomes permanent if RememberLeaderIndex? is false.
# $game_party.temp_leader(PartyIndex, RememberLeaderIndex?)
# - Restore the Previous Leader! (If Any!)
# $game_party.restore_leader
# - Set a Leader by Actor's ID!
# $game_party.set_leader_by_id(ActorID)
class Game_Party
def change_leader(n)
if n < 0
@actors.unshift @actors.pop
else
@actors << @actors.shift
end
end
def set_leader_by_id(actor_id)
n = @actors.index(actor_id)
swap_leader(n) if n
end
def temp_leader(n, remember)
@temp_leader_index = n if remember
swap_leader(n)
end
def restore_leader
return unless @temp_leader_index
n = @temp_leader_index
swap_leader(@temp_leader_index)
@temp_leader_index = nil
end
def leader
@actors[0]
end
private
def swap_leader(n)
@actors[0], @actors[n] = @actors[n], @actors[0]
$game_player.refresh
end
end
class Game_Player
alias :kyon_kuick_leader_swap_gm_plyr_up :update
def update
kyon_kuick_leader_swap_gm_plyr_up
if Input.trigger?(Input::L)
$game_party.change_leader(-1)
refresh
return
elsif Input.trigger?(Input::R)
$game_party.change_leader(1)
refresh
end
end
end
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
![[Image: SP1-Scripter.png]](https://www.save-point.org/images/userbars/SP1-Scripter.png)
![[Image: SP1-Writer.png]](https://www.save-point.org/images/userbars/SP1-Writer.png)
![[Image: SP1-Poet.png]](https://www.save-point.org/images/userbars/SP1-Poet.png)
![[Image: SP1-PixelArtist.png]](https://www.save-point.org/images/userbars/SP1-PixelArtist.png)
![[Image: SP1-Reporter.png]](https://i.postimg.cc/GmxWbHyL/SP1-Reporter.png)
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest & Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!
Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
![[Image: SP1-Scripter.png]](https://www.save-point.org/images/userbars/SP1-Scripter.png)
![[Image: SP1-Writer.png]](https://www.save-point.org/images/userbars/SP1-Writer.png)
![[Image: SP1-Poet.png]](https://www.save-point.org/images/userbars/SP1-Poet.png)
![[Image: SP1-PixelArtist.png]](https://www.save-point.org/images/userbars/SP1-PixelArtist.png)
![[Image: SP1-Reporter.png]](https://i.postimg.cc/GmxWbHyL/SP1-Reporter.png)
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest & Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE