Skip to content

Duel.SendtoHand ​

Signature ​

lua
Duel.SendtoHand(Card|Group targets, [int|nil player], int reason, [int reason_player]) -> int

Description ​

Sends targets to a hand for reason and returns the number of cards actually moved. Pass nil for player to use the normal return destination. Pass a specific player only when the effect says the cards go to that player's hand. When a hidden card is added and must be shown, confirm the moved card after this call succeeds.

How To Use It ​

Use this for adding or returning cards to the hand.

Pass nil for player when the card should go to its normal return destination. Pass a specific player only when the effect explicitly sends the card to that player's hand.

lua
if Duel.SendtoHand(sg,nil,REASON_EFFECT)>0 then
    Duel.ConfirmCards(1-tp,sg)
end

When the card came from a hidden location and must be shown, reveal the result with Duel.ConfirmCards after it reaches the hand.

Parameters ​

  • targets Card|Group
  • player int|nil optional
  • reason int
  • reason_player int optional

Returns ​

  • int

Source ​

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

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 3044 indexed script(s).
  • Search this function in the Script Explorer with Duel.SendtoHand.
CardIDScriptDetected Calls
Pendulum Evolution55795155Scripts/c55795155.lua1
Astrograph Sorcerer76794549Scripts/c76794549.lua1
Spellbook of the Grand Circle11911336Scripts/c11911336.lua1
Melffy Playtime Surprise58036097Scripts/c58036097.lua1
Ashtraja Susanoo17020474Scripts/c17020474.lua2
Deftero Enneacraft - "alazoneIA"92171126Scripts/c92171126.lua3
El Shaddoll Apkallone50907446Scripts/c50907446.lua1
Mementotlan Fusion66518509Scripts/c66518509.lua1
Meteoroa Drytron24166324Scripts/c24166324.lua1
Gem-Knight Dispersion24220368Scripts/c24220368.lua1
Performage Cup Tricker6812770Scripts/c6812770.lua1
Ehther the Heavenly Monarch96570609Scripts/c96570609.lua1
Ghostrick Renovation61818176Scripts/c61818176.lua1
Magnet Bonding65514302Scripts/c65514302.lua2
Hecahands Tartaros57809669Scripts/c57809669.lua1
Ursarctic Polari27693363Scripts/c27693363.lua1
Odd-Eyes Revolution Dragon16306932Scripts/c16306932.lua1
Aiwass, Divine Spirit of the Law84288367Scripts/c84288367.lua1
GMX 55th Experiment Report38984832Scripts/c38984832.lua1
PSY-Framelord Omega74586817Scripts/c74586817.lua1
D/D Count Surveyor5997110Scripts/c5997110.lua1
Nekroz Kaleidoscope51124303Scripts/c51124303.lua1
Enneacraft - Aiza.LEON82359538Scripts/c82359538.lua1
Junoldo the Shadespirit Power Patron10266279Scripts/c10266279.lua1
...and 3020 more

Script Examples ​

Pendulum Evolution (55795155) ​

Source: Scripts/c55795155.lua

lua
	local g=Duel.SelectMatchingCard(tp,c55795155.thfilter,tp,LOCATION_DECK,0,1,1,nil,e:GetLabel())
	if g:GetCount()>0 then
		Duel.SendtoHand(g,nil,REASON_EFFECT)
		Duel.ConfirmCards(1-tp,g)
	end

Astrograph Sorcerer (76794549) ​

Source: Scripts/c76794549.lua

lua
			Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
			local sg=Duel.SelectMatchingCard(tp,c76794549.thfilter2,tp,LOCATION_DECK,0,1,1,nil,cg:GetFirst():GetCode())
			Duel.SendtoHand(sg,nil,REASON_EFFECT)
			Duel.ConfirmCards(1-tp,sg)
		end

Spellbook of the Grand Circle (11911336) ​

Source: Scripts/c11911336.lua

lua
	Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
	local sg=g:SelectSubGroup(tp,aux.dabcheck,false,4,4)
	if Duel.SendtoHand(sg,nil,REASON_EFFECT)>0 then
		Duel.ConfirmCards(1-tp,sg)
		if sg:IsExists(Card.IsLocation,1,nil,LOCATION_HAND) and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>1 then