Skip to content

Duel.SendtoGrave ​

Signature ​

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

Description ​

Sends targets to the GY for reason, optionally treating reason_player as the player that moved them, and returns the number actually moved. This is not destruction by itself. Use Duel.Destroy for destroy effects, or include the correct discard/material/release reason flags when the card text or mechanic requires them.

How To Use It ​

Use this for sending cards to the Graveyard by effect, cost, discard, or material handling.

lua
if #g>0 then
    Duel.SendtoGrave(g,REASON_EFFECT)
end

This is not the same as destroying. A card sent to the Graveyard by Duel.SendtoGrave was not destroyed unless the reason and prior action also say it was destroyed.

Parameters ​

  • targets Card|Group - Card or Group to send to the Graveyard.
  • reason int - REASON_* flags recorded for the move.
  • reason_player int optional - Player recorded as the reason player; defaults to the core's current reason player.

Returns ​

  • int - Number of cards actually sent to the Graveyard.

Source ​

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

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 2387 indexed script(s).
  • Search this function in the Script Explorer with Duel.SendtoGrave.
CardIDScriptDetected Calls
Artmage Non-Finito74631897Scripts/c74631897.lua2
Levia-Dragoon - Daedalus78579058Scripts/c78579058.lua3
Azure Ocean Dragon Lord - Neo-Daedalus Rage41570943Scripts/c41570943.lua3
Eternal Favorite87532344Scripts/c87532344.lua2
Surprise Fusion35167375Scripts/c35167375.lua1
Spellbook of the Grand Circle11911336Scripts/c11911336.lua1
Ultra Polymerization76647978Scripts/c76647978.lua1
Melffy Playtime Surprise58036097Scripts/c58036097.lua1
Yomagna the Fire Phantom17350692Scripts/c17350692.lua1
Fiendsmith's Sequence49867899Scripts/c49867899.lua1
D/D/D Alfred the Divine Sage King11852093Scripts/c11852093.lua1
Mementotlan Fusion66518509Scripts/c66518509.lua1
Favorite HERO Flame Wingman13243124Scripts/c13243124.lua1
Gem-Knight Dispersion24220368Scripts/c24220368.lua1
Performage Cup Tricker6812770Scripts/c6812770.lua1
Ehther the Heavenly Monarch96570609Scripts/c96570609.lua1
Spirit Illusion71939275Scripts/c71939275.lua1
Pere-Zenet Em Heru46273941Scripts/c46273941.lua1
Am Duazenet45151304Scripts/c45151304.lua1
Ursarctic Polari27693363Scripts/c27693363.lua2
Odd-Eyes Revolution Dragon16306932Scripts/c16306932.lua1
Aiwass, Divine Spirit of the Law84288367Scripts/c84288367.lua1
Resurgam Xyz49082032Scripts/c49082032.lua1
GMX 55th Experiment Report38984832Scripts/c38984832.lua2
...and 2363 more

Script Examples ​

Artmage Non-Finito (74631897) ​

Source: Scripts/c74631897.lua

lua
	local dg=g:Filter(s.disfilter,nil)
	g:Sub(dg)
	Duel.SendtoGrave(dg,REASON_SPSUMMON+REASON_DISCARD)
	Duel.Release(g,REASON_SPSUMMON)
	g:DeleteGroup()

Levia-Dragoon - Daedalus (78579058) ​

Source: Scripts/c78579058.lua

lua
				c:SetMaterial(g)
				s.LExtraMaterialCount(g,c,tp)
				Duel.SendtoGrave(g,REASON_MATERIAL+REASON_LINK)
				g:DeleteGroup()
			end

Azure Ocean Dragon Lord - Neo-Daedalus Rage (41570943) ​

Source: Scripts/c41570943.lua

lua
				c:SetMaterial(g)
				s.LExtraMaterialCount(g,c,tp)
				Duel.SendtoGrave(g,REASON_MATERIAL+REASON_LINK)
				g:DeleteGroup()
			end