Skip to content

Duel.GetDecktopGroup ​

Signature ​

lua
Duel.GetDecktopGroup(int player, int count) -> Group

Description ​

Returns a Group containing up to count cards from the top of player's Deck. If count is larger than the remaining Deck size, only the available cards are included. This accessor does not confirm or reveal those cards by itself.

Parameters ​

  • player int - Player whose Deck is read.
  • count int - Maximum number of cards to include from the top of the Deck.

Returns ​

  • Group - New Group containing the top Deck cards, or an empty Group if no cards are available.

Source ​

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

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 200 indexed script(s).
  • Search this function in the Script Explorer with Duel.GetDecktopGroup.
CardIDScriptDetected Calls
GMX 55th Experiment Report38984832Scripts/c38984832.lua2
Junoldo the Shadespirit Power Patron10266279Scripts/c10266279.lua1
Flower Cardian Peony with Butterfly57261568Scripts/c57261568.lua2
Jupredo the Shademachine Power Patron43871165Scripts/c43871165.lua1
D/D Extra Surveyor74387963Scripts/c74387963.lua2
Nervedo the Shadebeast Power Patron17473466Scripts/c17473466.lua1
Purrely25550531Scripts/c25550531.lua3
Sylvan Dancepione21903613Scripts/c21903613.lua1
Squeeze, the Full Moon of Raise Moon - JACKPOT!9484285Scripts/c9484285.lua1
Materiactor Meltthrough66059345Scripts/c66059345.lua2
Mad Tempest Trirealm Rift Ploutonion33822112Scripts/c33822112.lua2
Time Thief Redoer55285840Scripts/c55285840.lua1
Ma'at18631392Scripts/c18631392.lua2
Loris, Lady of Lament50699850Scripts/c50699850.lua1
Silk Bomb Moth18300894Scripts/c18300894.lua1
Shadowreaver Knight 2195506252Scripts/c95506252.lua3
Bahalutiya, the Grand Radiance53318263Scripts/c53318263.lua2
Materiactor Meltdown38669664Scripts/c38669664.lua2
GMX Applied Experiment #5518795635Scripts/c18795635.lua1
Buerillabaisse de Nouvelles26223582Scripts/c26223582.lua1
Magikey Mechmusket - Batosbuster19489718Scripts/c19489718.lua1
Super Koi Koi66171432Scripts/c66171432.lua1
Mariamne, the True Dracophoenix94160895Scripts/c94160895.lua1
Chaos Ruler, the Chaotic Magical Dragon3040496Scripts/c3040496.lua1
...and 176 more

Script Examples ​

GMX 55th Experiment Report (38984832) ​

Source: Scripts/c38984832.lua

lua
	local max_decktop=5
	if count>max_decktop then
		local g=Duel.GetDecktopGroup(tp,count)
		Duel.ConfirmCards(1-tp,g)
	else

Junoldo the Shadespirit Power Patron (10266279) ​

Source: Scripts/c10266279.lua

lua
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
	local g=Duel.GetDecktopGroup(tp,3)
	if chk==0 then return g:FilterCount(Card.IsAbleToRemoveAsCost,nil,POS_FACEDOWN)==3
		and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=3

Flower Cardian Peony with Butterfly (57261568) ​

Source: Scripts/c57261568.lua

lua
			if ct==0 then return end
			Duel.BreakEffect()
			local g=Duel.GetDecktopGroup(1-tp,ct)
			Duel.ConfirmCards(tp,g)
			local opt=Duel.SelectOption(tp,aux.Stringid(57261568,1),aux.Stringid(57261568,2))