Skip to content

Duel.Remove ​

Signature ​

lua
Duel.Remove(Card|Group targets, int pos, int reason, [int reason_player]) -> int

Description ​

Banishes targets in position pos for reason and returns the number of cards actually banished. If reason includes REASON_TEMPORARY, the banish is treated as temporary and the card can later be returned with Duel.ReturnToField. Use POS_FACEDOWN only when the effect requires a face-down banish; ordinary banish effects usually use POS_FACEUP.

How To Use It ​

Use this for banishing cards. The second argument is the banished position, usually POS_FACEUP or POS_FACEDOWN.

lua
if c:IsRelateToEffect(e) then
    Duel.Remove(c,POS_FACEUP,REASON_EFFECT)
end

For temporary banish effects, scripts commonly include REASON_TEMPORARY; those cards can later be returned with Duel.ReturnToField.

Parameters ​

  • targets Card|Group
  • pos int
  • reason int
  • reason_player int optional

Returns ​

  • int

Source ​

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

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 1663 indexed script(s).
  • Search this function in the Script Explorer with Duel.Remove.
CardIDScriptDetected Calls
Lady's Dragonmaid48658295Scripts/c48658295.lua1
Astrograph Sorcerer76794549Scripts/c76794549.lua1
Accel Synchro Stardust Dragon30983281Scripts/c30983281.lua1
Ashtraja Susanoo17020474Scripts/c17020474.lua2
Deftero Enneacraft - "alazoneIA"92171126Scripts/c92171126.lua1
Destiny HERO - Destro-Dogma25158975Scripts/c25158975.lua1
Mixousia the Confounder80843006Scripts/c80843006.lua1
Invoked Sorath43989315Scripts/c43989315.lua1
Ehther the Heavenly Monarch96570609Scripts/c96570609.lua1
Destratification Dino Stratiae3841104Scripts/c3841104.lua1
Am Duazenet45151304Scripts/c45151304.lua1
Hecahands Tartaros57809669Scripts/c57809669.lua1
Ursarctic Polari27693363Scripts/c27693363.lua1
Prank-Kids Weather Washer44509529Scripts/c44509529.lua1
Enneacraft - Asta.PIXEA28454232Scripts/c28454232.lua1
Converging Wishes20007374Scripts/c20007374.lua2
Tohushaddoll Grysta95072744Scripts/c95072744.lua1
Predaplant Bal Teah66787942Scripts/c66787942.lua1
PSY-Framelord Omega74586817Scripts/c74586817.lua1
Teleport Fusion36494597Scripts/c36494597.lua1
D/D/D/D Dimensional King Arc Crisis71398055Scripts/c71398055.lua1
Dark End Evaporation Dragon62002838Scripts/c62002838.lua1
Nekroz Kaleidoscope51124303Scripts/c51124303.lua1
Junoldo the Shadespirit Power Patron10266279Scripts/c10266279.lua2
...and 1639 more

Script Examples ​

Lady's Dragonmaid (48658295) ​

Source: Scripts/c48658295.lua

lua
	local sg=e:GetLabelObject()
	c:SetMaterial(sg)
	Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function s.spfilter(c,e,tp)

Astrograph Sorcerer (76794549) ​

Source: Scripts/c76794549.lua

lua
	local sg=mg:SelectSubGroupEach(tp,c76794549.hnchecks,false,c76794549.hngoal,e,tp,c)
	sg:AddCard(c)
	Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function c76794549.hntg(e,tp,eg,ep,ev,re,r,rp,chk)

Accel Synchro Stardust Dragon (30983281) ​

Source: Scripts/c30983281.lua

lua
	local te=rc:IsHasEffect(84012625,tp)
	if te then
		Duel.Remove(rc,POS_FACEUP,REASON_COST+REASON_REPLACE)
	else
		Duel.Release(rc,REASON_COST)