Skip to content

Group.RandomSelect ​

Signature ​

lua
Group.RandomSelect(Group g, int player, int count) -> Group

Description ​

Returns a new Group containing count randomly chosen cards from g. count is clamped to g's size. The player argument is written to the random-selection message but does not influence the random choice.

Parameters ​

  • g Group
  • player int
  • count int

Returns ​

  • Group

Source ​

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

Used By ​

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

  • Detected in 142 indexed script(s).
  • Search this function in the Script Explorer with Group.RandomSelect.
CardIDScriptDetected Calls
Deftero Enneacraft - "alazoneIA"92171126Scripts/c92171126.lua2
Enneacraft - Asta.PIXEA28454232Scripts/c28454232.lua1
PSY-Framelord Omega74586817Scripts/c74586817.lua1
Erebus the Underworld Monarch23064604Scripts/c23064604.lua1
Genex Ally Triarm17760003Scripts/c17760003.lua1
Number 78: Number Archive29085954Scripts/c29085954.lua1
Mimighoul Maker13204145Scripts/c13204145.lua1
Ekto Enneacraft - "tromarIA"29570824Scripts/c29570824.lua1
Enato Enneacraft - "oknirIA"55965529Scripts/c55965529.lua1
Psychic Omnibuster70659412Scripts/c70659412.lua1
X-Saber Gottoms8252010Scripts/c8252010.lua1
Trito Enneacraft - "exapatisIA"44716748Scripts/c44716748.lua1
Proto Enneacraft - "orgIA"56187077Scripts/c56187077.lua1
Black Luster Soldier - Envoy of the Evening Twilight77498348Scripts/c77498348.lua1
Infernoid Piaty25811989Scripts/c25811989.lua1
Smile Action47870325Scripts/c47870325.lua1
Abyss Actor - Liberty Dramatist65477143Scripts/c65477143.lua1
Dinomist Rex63251695Scripts/c63251695.lua1
Hi-Speedroid Rubber Band Shooter72813401Scripts/c72813401.lua1
Evening Twilight Knight32013448Scripts/c32013448.lua1
Grapha, Dragon Lord of Dark World34230233Scripts/c34230233.lua1
Stellarknight Triverr42589641Scripts/c42589641.lua1
Spell Shattering Sword77456448Scripts/c77456448.lua1
Awakening of the Possessed - Gagigobyte74426895Scripts/c74426895.lua1
...and 118 more

Script Examples ​

Deftero Enneacraft - "alazoneIA" (92171126) ​

Source: Scripts/c92171126.lua

lua
		Duel.ConfirmCards(1-tp,sg)
		Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_ATOHAND)
		local tg=sg:RandomSelect(1-tp,1)
		Duel.ShuffleDeck(tp)
		tg:GetFirst():SetStatus(STATUS_TO_HAND_WITHOUT_CONFIRM,true)

Enneacraft - Asta.PIXEA (28454232) ​

Source: Scripts/c28454232.lua

lua
		local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil,POS_FACEDOWN)
		if g:GetCount()>0 then
			local sg=g:RandomSelect(tp,1)
			Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT)
		end

PSY-Framelord Omega (74586817) ​

Source: Scripts/c74586817.lua

lua
	local g=Duel.GetFieldGroup(1-tp,LOCATION_HAND,0)
	if g:GetCount()==0 or not c:IsRelateToEffect(e) or c:IsFacedown() then return end
	local rs=g:RandomSelect(1-tp,1)
	local rg=Group.FromCards(c,rs:GetFirst())
	if Duel.Remove(rg,POS_FACEUP,REASON_EFFECT+REASON_TEMPORARY)~=0 then