Lilith,
If this card is Normal Summoned, its original ATK becomes 1000. (Quick Effect): You can Tribute 1 DARK monster; reveal 3 Normal Traps from your Deck, your opponent randomly chooses 1 for you to Set on your field, and you shuffle the rest back into your Deck. You can only use this effect of "Lilith, Lady of Lament" once per turn.
local s, id, o = GetID()
function s.initial_effect(c)
	--atk
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_SINGLE)
	e1:SetCode(EFFECT_SUMMON_COST)
	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
	e1:SetOperation(s.regop)
	c:RegisterEffect(e1)
	--search
	local e2 = Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_QUICK_O)
	e2:SetCode(EVENT_FREE_CHAIN)
	e2:SetRange(LOCATION_MZONE)
	e2:SetCountLimit(1, id)
	e2:SetCost(s.thcost)
	e2:SetTarget(s.thtg)
	e2:SetOperation(s.thop)
	c:RegisterEffect(e2)
end
function s.regop(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_SINGLE)
	e1:SetCode(EFFECT_SET_BASE_ATTACK)
	e1:SetValue(1000)
	e1:SetReset(RESET_EVENT + RESETS_STANDARD - RESET_TOFIELD + RESET_DISABLE)
	c:RegisterEffect(e1)
end
function s.thcost(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.CheckReleaseGroup(tp, Card.IsAttribute, 1, nil, ATTRIBUTE_DARK)
	end
	local g = Duel.SelectReleaseGroup(tp, Card.IsAttribute, 1, 1, nil, ATTRIBUTE_DARK)
	Duel.Release(g, REASON_COST)
end
function s.thfilter(c)
	return c:GetType() == TYPE_TRAP and c:IsSSetable()
end
function s.thtg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.GetLocationCount(tp, LOCATION_SZONE) > 0 and Duel.IsExistingMatchingCard(s.thfilter, tp, LOCATION_DECK, 0, 3, nil)
	end
	Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, tp, LOCATION_DECK)
end
function s.thop(e, tp, eg, ep, ev, re, r, rp)
	local g = Duel.GetMatchingGroup(s.thfilter, tp, LOCATION_DECK, 0, nil)
	if g:GetCount() >= 3 then
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SET)
		local sg = g:Select(tp, 3, 3, nil)
		Duel.ConfirmCards(1 - tp, sg)
		Duel.Hint(HINT_SELECTMSG, 1 - tp, HINTMSG_SET)
		local tg = sg:RandomSelect(1 - tp, 1)
		Duel.ShuffleDeck(tp)
		Duel.SSet(tp, tg, tp, false)
	end
end


Lilith,
If this card is Normal Summoned, its original ATK becomes 1000. (Quick Effect): You can Tribute 1 DARK monster; reveal 3 Normal Traps from your Deck, your opponent randomly chooses 1 for you to Set on your field, and you shuffle the rest back into your Deck. You can only use this effect of "Lilith, Lady of Lament" once per turn.
-- Lilith,
local s, id, o = GetID()
function s.initial_effect(c)
	--atk
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_SINGLE)
	e1:SetCode(EFFECT_SUMMON_COST)
	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
	e1:SetOperation(s.regop)
	c:RegisterEffect(e1)
	--search
	local e2 = Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_QUICK_O)
	e2:SetCode(EVENT_FREE_CHAIN)
	e2:SetRange(LOCATION_MZONE)
	e2:SetCountLimit(1, id)
	e2:SetCost(s.thcost)
	e2:SetTarget(s.thtg)
	e2:SetOperation(s.thop)
	c:RegisterEffect(e2)
end
function s.regop(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_SINGLE)
	e1:SetCode(EFFECT_SET_BASE_ATTACK)
	e1:SetValue(1000)
	e1:SetReset(RESET_EVENT + RESETS_STANDARD - RESET_TOFIELD + RESET_DISABLE)
	c:RegisterEffect(e1)
end
function s.thcost(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.CheckReleaseGroup(tp, Card.IsAttribute, 1, nil, ATTRIBUTE_DARK)
	end
	local g = Duel.SelectReleaseGroup(tp, Card.IsAttribute, 1, 1, nil, ATTRIBUTE_DARK)
	Duel.Release(g, REASON_COST)
end
function s.thfilter(c)
	return c:GetType() == TYPE_TRAP and c:IsSSetable()
end
function s.thtg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.GetLocationCount(tp, LOCATION_SZONE) > 0 and Duel.IsExistingMatchingCard(s.thfilter, tp, LOCATION_DECK, 0, 3, nil)
	end
	Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, tp, LOCATION_DECK)
end
function s.thop(e, tp, eg, ep, ev, re, r, rp)
	local g = Duel.GetMatchingGroup(s.thfilter, tp, LOCATION_DECK, 0, nil)
	if g:GetCount() >= 3 then
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SET)
		local sg = g:Select(tp, 3, 3, nil)
		Duel.ConfirmCards(1 - tp, sg)
		Duel.Hint(HINT_SELECTMSG, 1 - tp, HINTMSG_SET)
		local tg = sg:RandomSelect(1 - tp, 1)
		Duel.ShuffleDeck(tp)
		Duel.SSet(tp, tg, tp, false)
	end
end

