Jackpot
When this card is activated: Shuffle this card from the field into the Deck. When this card in your possession is sent to your Graveyard by an opponent's card effect: Banish this card. If 3 of your "Jackpot 7" are currently banished, and were all banished by this effect, you win the Duel.
local CARD_ID_0 = 4130270 --G.B. Hunter

local CARD_ID_0 = 4130270 --G.B. Hunter
local s, id, o = GetID()
function s.initial_effect(c)
	--Activate
	local e1 = Effect.CreateEffect(c)
	e1:SetCategory(CATEGORY_TODECK)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetCode(EVENT_FREE_CHAIN)
	e1:SetCost(s.cost)
	e1:SetTarget(s.target)
	e1:SetOperation(s.activate)
	c:RegisterEffect(e1)
	--remove
	local e2 = Effect.CreateEffect(c)
	e2:SetDescription(aux.Stringid(id, 0))
	e2:SetCategory(CATEGORY_REMOVE)
	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
	e2:SetCode(EVENT_TO_GRAVE)
	e2:SetCondition(s.rmcon)
	e2:SetTarget(s.rmtg)
	e2:SetOperation(s.rmop)
	c:RegisterEffect(e2)
end
function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
	e:SetLabel(1)
	return true
end
function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		if e:GetLabel() == 0 then
			return false
		end
		e:SetLabel(0)
		return not Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0)
	end
	e:SetLabel(0)
	Duel.SetOperationInfo(0, CATEGORY_TODECK, e:GetHandler(), 1, 0, 0)
end
function s.activate(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	if c:IsRelateToEffect(e) then
		Duel.SendtoDeck(c, nil, SEQ_DECKSHUFFLE, REASON_EFFECT, tp, true)
	end
end
function s.rmcon(e, tp, eg, ep, ev, re, r, rp)
	return rp == 1 - tp and bit.band(r, REASON_EFFECT) ~= 0 and bit.band(r, REASON_RETURN) == 0
end
function s.rmtg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return true
	end
	Duel.SetOperationInfo(0, CATEGORY_REMOVE, e:GetHandler(), 1, tp, LOCATION_GRAVE)
end
function s.filter(c)
	return c:IsCode(id) and c:GetFlagEffect(id) ~= 0
end
function s.rmop(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	if c:IsRelateToEffect(e) and Duel.Remove(c, POS_FACEUP, REASON_EFFECT) ~= 0 then
		c:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 0)
		if Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_REMOVED, 0, 3, nil) then
			local WIN_REASON_JACKPOT7 = 0x19
			Duel.Win(tp, WIN_REASON_JACKPOT7)
		end
	end
end


Jackpot
When this card is activated: Shuffle this card from the field into the Deck. When this card in your possession is sent to your Graveyard by an opponent's card effect: Banish this card. If 3 of your "Jackpot 7" are currently banished, and were all banished by this effect, you win the Duel.
-- Jackpot
local CARD_ID_0 = 4130270 --G.B. Hunter
local s, id, o = GetID()
function s.initial_effect(c)
	--Activate
	local e1 = Effect.CreateEffect(c)
	e1:SetCategory(CATEGORY_TODECK)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetCode(EVENT_FREE_CHAIN)
	e1:SetCost(s.cost)
	e1:SetTarget(s.target)
	e1:SetOperation(s.activate)
	c:RegisterEffect(e1)
	--remove
	local e2 = Effect.CreateEffect(c)
	e2:SetDescription(aux.Stringid(id, 0))
	e2:SetCategory(CATEGORY_REMOVE)
	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
	e2:SetCode(EVENT_TO_GRAVE)
	e2:SetCondition(s.rmcon)
	e2:SetTarget(s.rmtg)
	e2:SetOperation(s.rmop)
	c:RegisterEffect(e2)
end
function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
	e:SetLabel(1)
	return true
end
function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		if e:GetLabel() == 0 then
			return false
		end
		e:SetLabel(0)
		return not Duel.IsPlayerAffectedByEffect(tp, CARD_ID_0)
	end
	e:SetLabel(0)
	Duel.SetOperationInfo(0, CATEGORY_TODECK, e:GetHandler(), 1, 0, 0)
end
function s.activate(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	if c:IsRelateToEffect(e) then
		Duel.SendtoDeck(c, nil, SEQ_DECKSHUFFLE, REASON_EFFECT, tp, true)
	end
end
function s.rmcon(e, tp, eg, ep, ev, re, r, rp)
	return rp == 1 - tp and bit.band(r, REASON_EFFECT) ~= 0 and bit.band(r, REASON_RETURN) == 0
end
function s.rmtg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return true
	end
	Duel.SetOperationInfo(0, CATEGORY_REMOVE, e:GetHandler(), 1, tp, LOCATION_GRAVE)
end
function s.filter(c)
	return c:IsCode(id) and c:GetFlagEffect(id) ~= 0
end
function s.rmop(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	if c:IsRelateToEffect(e) and Duel.Remove(c, POS_FACEUP, REASON_EFFECT) ~= 0 then
		c:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 0)
		if Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_REMOVED, 0, 3, nil) then
			local WIN_REASON_JACKPOT7 = 0x19
			Duel.Win(tp, WIN_REASON_JACKPOT7)
		end
	end
end

