Duel.SendtoHand
Signature
Duel.SendtoHand(Card|Group targets, [int|nil player], int reason, [int reason_player]) -> intDescription
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.
if Duel.SendtoHand(sg,nil,REASON_EFFECT)>0 then
Duel.ConfirmCards(1-tp,sg)
endWhen the card came from a hidden location and must be shown, reveal the result with Duel.ConfirmCards after it reaches the hand.
Related Functions
Parameters
targetsCard|Groupplayerint|niloptionalreasonintreason_playerintoptional
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.
Script Examples
Pendulum Evolution (55795155)
Source: Scripts/c55795155.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)
endAstrograph Sorcerer (76794549)
Source: Scripts/c76794549.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)
endSpellbook of the Grand Circle (11911336)
Source: Scripts/c11911336.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