Beetrooper
You can Special Summon this card (from your hand) by banishing 1 Insect monster from your GY. You can only Special Summon "Beetrooper Assault Roller" once per turn this way. Gains 200 ATK for each Insect monster you control, except this card. When this card is destroyed by battle: You can add 1 "Beetrooper" monster from your Deck to your hand, except "Beetrooper Assault Roller". You can only use this effect of "Beetrooper Assault Roller" once per turn.
local SETCARD_ID_0 = 0x170 --Beetrooper

local SETCARD_ID_0 = 0x170 --Beetrooper
local s, id, o = GetID()
function s.initial_effect(c)
	--spsummon proc
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_FIELD)
	e1:SetCode(EFFECT_SPSUMMON_PROC)
	e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
	e1:SetRange(LOCATION_HAND)
	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
	e1:SetCondition(s.spcon)
	e1:SetTarget(s.sptg)
	e1:SetOperation(s.spop)
	c:RegisterEffect(e1)
	--atkup
	local e2 = Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_SINGLE)
	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
	e2:SetRange(LOCATION_MZONE)
	e2:SetCode(EFFECT_UPDATE_ATTACK)
	e2:SetValue(s.atkup)
	c:RegisterEffect(e2)
	--search
	local e3 = Effect.CreateEffect(c)
	e3:SetCategory(CATEGORY_SEARCH + CATEGORY_TOHAND)
	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
	e3:SetCode(EVENT_BATTLE_DESTROYED)
	e3:SetCountLimit(1, id + 1)
	e3:SetTarget(s.sctg)
	e3:SetOperation(s.scop)
	c:RegisterEffect(e3)
end
function s.spcostfilter1(c)
	return c:IsAbleToRemoveAsCost() and c:IsRace(RACE_INSECT)
end
function s.spcon(e, c)
	if c == nil then
		return true
	end
	local tp = c:GetControler()
	if Duel.GetMZoneCount(tp) <= 0 then
		return false
	end
	local g = Duel.GetMatchingGroup(s.spcostfilter1, tp, LOCATION_GRAVE, 0, nil)
	return #g > 0
end
function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, c)
	local g = Duel.GetMatchingGroup(s.spcostfilter1, tp, LOCATION_GRAVE, 0, nil)
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
	local tc = g:SelectUnselect(nil, tp, false, true, 1, 1)
	if tc then
		e:SetLabelObject(tc)
		return true
	else
		return false
	end
end
function s.spop(e, tp, eg, ep, ev, re, r, rp, c)
	local sg = e:GetLabelObject()
	Duel.Remove(sg, POS_FACEUP, REASON_SPSUMMON)
end
function s.atkfilter(c)
	return c:IsFaceup() and c:IsRace(RACE_INSECT)
end
function s.atkup(e, c)
	return Duel.GetMatchingGroupCount(s.atkfilter, e:GetHandlerPlayer(), LOCATION_MZONE, 0, e:GetHandler()) * 200
end
function s.filter(c)
	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and not c:IsCode(id) and c:IsAbleToHand()
end
function s.sctg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_DECK, 0, 1, nil)
	end
	Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, tp, LOCATION_DECK)
end
function s.scop(e, tp, eg, ep, ev, re, r, rp)
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
	local g = Duel.SelectMatchingCard(tp, s.filter, tp, LOCATION_DECK, 0, 1, 1, nil)
	if g:GetCount() > 0 then
		Duel.SendtoHand(g, nil, REASON_EFFECT)
		Duel.ConfirmCards(1 - tp, g)
	end
end


Beetrooper
You can Special Summon this card (from your hand) by banishing 1 Insect monster from your GY. You can only Special Summon "Beetrooper Assault Roller" once per turn this way. Gains 200 ATK for each Insect monster you control, except this card. When this card is destroyed by battle: You can add 1 "Beetrooper" monster from your Deck to your hand, except "Beetrooper Assault Roller". You can only use this effect of "Beetrooper Assault Roller" once per turn.
-- Beetrooper
local SETCARD_ID_0 = 0x170 --Beetrooper
local s, id, o = GetID()
function s.initial_effect(c)
	--spsummon proc
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_FIELD)
	e1:SetCode(EFFECT_SPSUMMON_PROC)
	e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
	e1:SetRange(LOCATION_HAND)
	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
	e1:SetCondition(s.spcon)
	e1:SetTarget(s.sptg)
	e1:SetOperation(s.spop)
	c:RegisterEffect(e1)
	--atkup
	local e2 = Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_SINGLE)
	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
	e2:SetRange(LOCATION_MZONE)
	e2:SetCode(EFFECT_UPDATE_ATTACK)
	e2:SetValue(s.atkup)
	c:RegisterEffect(e2)
	--search
	local e3 = Effect.CreateEffect(c)
	e3:SetCategory(CATEGORY_SEARCH + CATEGORY_TOHAND)
	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
	e3:SetCode(EVENT_BATTLE_DESTROYED)
	e3:SetCountLimit(1, id + 1)
	e3:SetTarget(s.sctg)
	e3:SetOperation(s.scop)
	c:RegisterEffect(e3)
end
function s.spcostfilter1(c)
	return c:IsAbleToRemoveAsCost() and c:IsRace(RACE_INSECT)
end
function s.spcon(e, c)
	if c == nil then
		return true
	end
	local tp = c:GetControler()
	if Duel.GetMZoneCount(tp) <= 0 then
		return false
	end
	local g = Duel.GetMatchingGroup(s.spcostfilter1, tp, LOCATION_GRAVE, 0, nil)
	return #g > 0
end
function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, c)
	local g = Duel.GetMatchingGroup(s.spcostfilter1, tp, LOCATION_GRAVE, 0, nil)
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
	local tc = g:SelectUnselect(nil, tp, false, true, 1, 1)
	if tc then
		e:SetLabelObject(tc)
		return true
	else
		return false
	end
end
function s.spop(e, tp, eg, ep, ev, re, r, rp, c)
	local sg = e:GetLabelObject()
	Duel.Remove(sg, POS_FACEUP, REASON_SPSUMMON)
end
function s.atkfilter(c)
	return c:IsFaceup() and c:IsRace(RACE_INSECT)
end
function s.atkup(e, c)
	return Duel.GetMatchingGroupCount(s.atkfilter, e:GetHandlerPlayer(), LOCATION_MZONE, 0, e:GetHandler()) * 200
end
function s.filter(c)
	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and not c:IsCode(id) and c:IsAbleToHand()
end
function s.sctg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_DECK, 0, 1, nil)
	end
	Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, tp, LOCATION_DECK)
end
function s.scop(e, tp, eg, ep, ev, re, r, rp)
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
	local g = Duel.SelectMatchingCard(tp, s.filter, tp, LOCATION_DECK, 0, 1, 1, nil)
	if g:GetCount() > 0 then
		Duel.SendtoHand(g, nil, REASON_EFFECT)
		Duel.ConfirmCards(1 - tp, g)
	end
end

