Skip to content

Duel.SwapControl ​

Signature ​

lua
Duel.SwapControl(Card|Group targets1, Card|Group targets2, [int reset_phase], [int reset_count]) -> bool

Description ​

Swaps control between two Cards or between two Groups and returns whether the swap processor succeeded. reset_phase and reset_count are optional temporary-control reset settings.

Parameters ​

  • targets1 Card|Group
  • targets2 Card|Group
  • reset_phase int optional - default: 0
  • reset_count int optional - default: 0

Returns ​

  • bool

Source ​

  • D:\Programs\GitHub\ygopro-core\libduel.cpp:4907

Guided Examples ​

Learn how to use this function in context:

Used By ​

Generated from the local Scripts/ folder and cards.cdb.

  • Detected in 19 indexed script(s).
  • Search this function in the Script Explorer with Duel.SwapControl.
CardIDScriptDetected Calls
Yummy★Redemption65853758Scripts/c65853758.lua1
Giant Ballgame60619435Scripts/c60619435.lua1
Vampire Red Baron6917479Scripts/c6917479.lua1
Abyss Actor - Comic Relief15308295Scripts/c15308295.lua1
Evil★Twin Present60759087Scripts/c60759087.lua1
Mind Castlin12172567Scripts/c12172567.lua2
Psychic Jumper52430902Scripts/c52430902.lua1
Geonator Transverser52119435Scripts/c52119435.lua1
Reeze, Whirlwind of Gusto36331074Scripts/c36331074.lua1
Packet Swap75153328Scripts/c75153328.lua1
Xyz Reversal66604523Scripts/c66604523.lua1
TG1-EM176641981Scripts/c76641981.lua1
Mirror Gate43452193Scripts/c43452193.lua1
Invader of the Throne3056267Scripts/c3056267.lua1
Interdimensional Warp57384901Scripts/c57384901.lua1
Creature Swap31036355Scripts/c31036355.lua1
Dummy Golem13532663Scripts/c13532663.lua1
Creature Seizure15305240Scripts/c15305240.lua1
Switcheroroo30426226Scripts/c30426226.lua1

Script Examples ​

Yummy★Redemption (65853758) ​

Source: Scripts/c65853758.lua

lua
	local b=g:GetNext()
	if a:IsRelateToEffect(e) and b:IsRelateToEffect(e) then
		Duel.SwapControl(a,b)
	end
end

Giant Ballgame (60619435) ​

Source: Scripts/c60619435.lua

lua
	local tc2=g:Filter(Card.IsControler,nil,1-tp):GetFirst()
	if tc and tc2 then
		if Duel.SwapControl(tc,tc2) then
			local e1=Effect.CreateEffect(e:GetHandler())
			e1:SetType(EFFECT_TYPE_SINGLE)

Vampire Red Baron (6917479) ​

Source: Scripts/c6917479.lua

lua
	local b=g:GetNext()
	if a:IsRelateToEffect(e) and b:IsRelateToEffect(e) then
		Duel.SwapControl(a,b)
	end
end