Skip to content

Group.Select ​

Signature ​

lua
Group.Select(Group g, int player, int min, int max, [Card|Group|nil ex]) -> Group|nil

Description ​

Lets player choose min to max cards from g, optionally excluding ex, and returns the selected Group. This is a plain Group choice; it does not register Chain targets or create IsRelateToEffect relations.

How To Use It ​

Use this when you already built the candidate Group and only need the player to choose from it.

lua
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_GRAVE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)

If you still need to filter while selecting, use Group.FilterSelect or Duel.SelectMatchingCard instead.

Parameters ​

  • g Group - Selectable card pool.
  • player int - Player who makes the selection; invalid players make the core return no values.
  • min int - Minimum number of cards to select.
  • max int - Maximum number of cards to select.
  • ex Card|Group|nil optional - Card or Group excluded from selectable cards; nil excludes nothing.

Returns ​

  • Group|nil - New Group containing selected cards, or nil if player is invalid.

Source ​

  • D:\Programs\GitHub\ygopro-core\libgroup.cpp:915

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 1417 indexed script(s).
  • Search this function in the Script Explorer with Group.Select.
CardIDScriptDetected Calls
Salamandra with Chain62091148Scripts/c62091148.lua1
Astrograph Sorcerer, the Starfrost Magician48171151Scripts/c48171151.lua2
Artmage Non-Finito74631897Scripts/c74631897.lua1
Lady's Dragonmaid48658295Scripts/c48658295.lua1
Azure Ocean Dragon Lord - Neo-Daedalus Rage41570943Scripts/c41570943.lua1
Eternal Favorite87532344Scripts/c87532344.lua1
Surprise Fusion35167375Scripts/c35167375.lua1
Astrograph Sorcerer76794549Scripts/c76794549.lua1
Spellbook of the Grand Circle11911336Scripts/c11911336.lua1
Ultra Polymerization76647978Scripts/c76647978.lua1
Accel Synchro Stardust Dragon30983281Scripts/c30983281.lua2
Melffy Playtime Surprise58036097Scripts/c58036097.lua1
Deftero Enneacraft - "alazoneIA"92171126Scripts/c92171126.lua1
Destiny HERO - Destro-Dogma25158975Scripts/c25158975.lua1
Yomagna the Fire Phantom17350692Scripts/c17350692.lua1
Fiendsmith's Sequence49867899Scripts/c49867899.lua1
D/D/D Alfred the Divine Sage King11852093Scripts/c11852093.lua2
Mementotlan Fusion66518509Scripts/c66518509.lua1
Favorite HERO Flame Wingman13243124Scripts/c13243124.lua2
Mixousia the Confounder80843006Scripts/c80843006.lua1
Gem-Knight Dispersion24220368Scripts/c24220368.lua1
Invoked Sorath43989315Scripts/c43989315.lua1
Performage Cup Tricker6812770Scripts/c6812770.lua1
Spirit Illusion71939275Scripts/c71939275.lua1
...and 1393 more

Script Examples ​

Salamandra with Chain (62091148) ​

Source: Scripts/c62091148.lua

lua
		if sg2 then sg:Merge(sg2) end
		Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
		local tg=sg:Select(tp,1,1,nil)
		local tc=tg:GetFirst()
		if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then

Astrograph Sorcerer, the Starfrost Magician (48171151) ​

Source: Scripts/c48171151.lua

lua
	if #desg>0 and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
		Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
		local sg=desg:Select(tp,1,1,nil)
		local tc=sg:GetFirst()
		if tc then

Artmage Non-Finito (74631897) ​

Source: Scripts/c74631897.lua

lua
		if sg2 then sg:Merge(sg2) end
		Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
		local tg=sg:Select(tp,1,1,nil)
		local tc=tg:GetFirst()
		if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or ce and not Duel.SelectYesNo(tp,ce:GetDescription())) then