Worm
This card can be Tribute Summoned in face-up Attack Position by Tributing 1 Reptile-Type "Worm" monster. You can Tribute 1 Reptile-Type "Worm" monster to select 1 card your opponent controls, and destroy it.
local SETCARD_ID_0 = 0x3e --Worm

local SETCARD_ID_0 = 0x3e --Worm
local s, id, o = GetID()
function s.initial_effect(c)
	--summon with 1 tribute
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
	e1:SetType(EFFECT_TYPE_SINGLE)
	e1:SetCode(EFFECT_SUMMON_PROC)
	e1:SetCondition(s.otcon)
	e1:SetOperation(s.otop)
	e1:SetValue(SUMMON_TYPE_ADVANCE)
	c:RegisterEffect(e1)
	--destroy
	local e2 = Effect.CreateEffect(c)
	e2:SetDescription(aux.Stringid(id, 1))
	e2:SetCategory(CATEGORY_DESTROY)
	e2:SetType(EFFECT_TYPE_IGNITION)
	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
	e2:SetRange(LOCATION_MZONE)
	e2:SetCost(s.descost)
	e2:SetTarget(s.destg)
	e2:SetOperation(s.desop)
	c:RegisterEffect(e2)
end
function s.cfilter(c, tp)
	return c:IsSetCard(SETCARD_ID_0) and c:IsRace(RACE_REPTILE) and (c:IsControler(tp) or c:IsFaceup())
end
function s.otcon(e, c, minc)
	if c == nil then
		return true
	end
	local tp = c:GetControler()
	local mg = Duel.GetMatchingGroup(s.cfilter, tp, LOCATION_MZONE, LOCATION_MZONE, nil, tp)
	return c:IsLevelAbove(7) and minc <= 1 and Duel.CheckTribute(c, 1, 1, mg)
end
function s.otop(e, tp, eg, ep, ev, re, r, rp, c)
	local mg = Duel.GetMatchingGroup(s.cfilter, tp, LOCATION_MZONE, LOCATION_MZONE, nil, tp)
	local sg = Duel.SelectTribute(tp, c, 1, 1, mg)
	c:SetMaterial(sg)
	Duel.Release(sg, REASON_SUMMON + REASON_MATERIAL)
end
function s.descost(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.CheckReleaseGroup(tp, s.cfilter, 1, nil, tp)
	end
	local sg = Duel.SelectReleaseGroup(tp, s.cfilter, 1, 1, nil, tp)
	Duel.Release(sg, REASON_COST)
end
function s.destg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	if chkc then
		return chkc:IsControler(1 - tp) and chkc:IsOnField()
	end
	if chk == 0 then
		return Duel.IsExistingTarget(aux.TRUE, tp, 0, LOCATION_ONFIELD, 1, nil)
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
	local g = Duel.SelectTarget(tp, aux.TRUE, tp, 0, LOCATION_ONFIELD, 1, 1, nil)
	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, 1, 0, 0)
end
function s.desop(e, tp, eg, ep, ev, re, r, rp)
	local tc = Duel.GetFirstTarget()
	if tc and tc:IsRelateToEffect(e) then
		Duel.Destroy(tc, REASON_EFFECT)
	end
end


Worm
This card can be Tribute Summoned in face-up Attack Position by Tributing 1 Reptile-Type "Worm" monster. You can Tribute 1 Reptile-Type "Worm" monster to select 1 card your opponent controls, and destroy it.
-- Worm
local SETCARD_ID_0 = 0x3e --Worm
local s, id, o = GetID()
function s.initial_effect(c)
	--summon with 1 tribute
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
	e1:SetType(EFFECT_TYPE_SINGLE)
	e1:SetCode(EFFECT_SUMMON_PROC)
	e1:SetCondition(s.otcon)
	e1:SetOperation(s.otop)
	e1:SetValue(SUMMON_TYPE_ADVANCE)
	c:RegisterEffect(e1)
	--destroy
	local e2 = Effect.CreateEffect(c)
	e2:SetDescription(aux.Stringid(id, 1))
	e2:SetCategory(CATEGORY_DESTROY)
	e2:SetType(EFFECT_TYPE_IGNITION)
	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
	e2:SetRange(LOCATION_MZONE)
	e2:SetCost(s.descost)
	e2:SetTarget(s.destg)
	e2:SetOperation(s.desop)
	c:RegisterEffect(e2)
end
function s.cfilter(c, tp)
	return c:IsSetCard(SETCARD_ID_0) and c:IsRace(RACE_REPTILE) and (c:IsControler(tp) or c:IsFaceup())
end
function s.otcon(e, c, minc)
	if c == nil then
		return true
	end
	local tp = c:GetControler()
	local mg = Duel.GetMatchingGroup(s.cfilter, tp, LOCATION_MZONE, LOCATION_MZONE, nil, tp)
	return c:IsLevelAbove(7) and minc <= 1 and Duel.CheckTribute(c, 1, 1, mg)
end
function s.otop(e, tp, eg, ep, ev, re, r, rp, c)
	local mg = Duel.GetMatchingGroup(s.cfilter, tp, LOCATION_MZONE, LOCATION_MZONE, nil, tp)
	local sg = Duel.SelectTribute(tp, c, 1, 1, mg)
	c:SetMaterial(sg)
	Duel.Release(sg, REASON_SUMMON + REASON_MATERIAL)
end
function s.descost(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.CheckReleaseGroup(tp, s.cfilter, 1, nil, tp)
	end
	local sg = Duel.SelectReleaseGroup(tp, s.cfilter, 1, 1, nil, tp)
	Duel.Release(sg, REASON_COST)
end
function s.destg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	if chkc then
		return chkc:IsControler(1 - tp) and chkc:IsOnField()
	end
	if chk == 0 then
		return Duel.IsExistingTarget(aux.TRUE, tp, 0, LOCATION_ONFIELD, 1, nil)
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
	local g = Duel.SelectTarget(tp, aux.TRUE, tp, 0, LOCATION_ONFIELD, 1, 1, nil)
	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, 1, 0, 0)
end
function s.desop(e, tp, eg, ep, ev, re, r, rp)
	local tc = Duel.GetFirstTarget()
	if tc and tc:IsRelateToEffect(e) then
		Duel.Destroy(tc, REASON_EFFECT)
	end
end

