Tilting
1 Tuner + 1+ non-Tuner monsters
If this card is Synchro Summoned: You can Special Summon 1 Level 4 or lower Pendulum Monster from your hand or face-up from your Extra Deck. At the end of the Damage Step, when this card or your Pendulum Monster battles an opponent's monster, but the opponent's monster was not destroyed by the battle: You can destroy that opponent's monster. You can only use each effect of "Tilting Entrainment" once per turn.
local s, id, o = GetID()
function s.initial_effect(c)
	--Synchro summon
	aux.AddSynchroProcedure(c, nil, aux.NonTuner(nil), 1)
	c:EnableReviveLimit()
	--special summon
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
	e1:SetProperty(EFFECT_FLAG_DELAY)
	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
	e1:SetCountLimit(1, id)
	e1:SetCondition(s.spcon)
	e1:SetTarget(s.sptg)
	e1:SetOperation(s.spop)
	c:RegisterEffect(e1)
	--Destroy
	local e2 = Effect.CreateEffect(c)
	e2:SetDescription(aux.Stringid(id, 1))
	e2:SetCategory(CATEGORY_DESTROY)
	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
	e2:SetCountLimit(1, id + 1)
	e2:SetCode(EVENT_DAMAGE_STEP_END)
	e2:SetCondition(s.descon)
	e2:SetTarget(s.destg)
	e2:SetOperation(s.desop)
	c:RegisterEffect(e2)
	local e3 = e2:Clone()
	e3:SetRange(LOCATION_MZONE)
	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
	e3:SetCondition(s.descon2)
	c:RegisterEffect(e3)
end
function s.spcon(e, tp, eg, ep, ev, re, r, rp)
	return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function s.spfilter(c, e, tp)
	return (c:IsLocation(LOCATION_HAND) or c:IsFaceup())
		and c:IsType(TYPE_PENDULUM)
		and c:IsLevelBelow(4)
		and c:IsCanBeSpecialSummoned(e, 0, tp, false, false, POS_FACEUP)
		and (c:IsLocation(LOCATION_HAND) and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 or c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp, tp, nil, c) > 0)
end
function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_HAND + LOCATION_EXTRA, 0, 1, nil, e, tp)
	end
	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_HAND + LOCATION_EXTRA)
end
function s.spop(e, tp, eg, ep, ev, re, r, rp)
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
	local g = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_HAND + LOCATION_EXTRA, 0, 1, 1, nil, e, tp)
	if g:GetCount() > 0 then
		Duel.SpecialSummon(g, 0, tp, tp, false, false, POS_FACEUP)
	end
end
function s.descon(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	local bc = c:GetBattleTarget()
	e:SetLabelObject(bc)
	return aux.dsercon(e, tp, eg, ep, ev, re, r, rp) and bc and bc:IsRelateToBattle() and bc:IsOnField() and c:IsStatus(STATUS_OPPO_BATTLE)
end
function s.descon2(e, tp, eg, ep, ev, re, r, rp)
	local tc, bc = Duel.GetBattleMonster(tp)
	e:SetLabelObject(bc)
	return tc and bc and tc:IsStatus(STATUS_OPPO_BATTLE) and bc:IsOnField() and bc:IsRelateToBattle() and tc:IsFaceup() and tc:IsType(TYPE_PENDULUM)
end
function s.destg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return true
	end
	Duel.SetOperationInfo(0, CATEGORY_DESTROY, e:GetLabelObject(), 1, 0, 0)
end
function s.desop(e, tp, eg, ep, ev, re, r, rp)
	local bc = e:GetLabelObject()
	if bc:IsRelateToBattle() and bc:IsControler(1 - tp) then
		Duel.Destroy(bc, REASON_EFFECT)
	end
end


Tilting
1 Tuner + 1+ non-Tuner monsters
If this card is Synchro Summoned: You can Special Summon 1 Level 4 or lower Pendulum Monster from your hand or face-up from your Extra Deck. At the end of the Damage Step, when this card or your Pendulum Monster battles an opponent's monster, but the opponent's monster was not destroyed by the battle: You can destroy that opponent's monster. You can only use each effect of "Tilting Entrainment" once per turn.
-- Tilting
local s, id, o = GetID()
function s.initial_effect(c)
	--Synchro summon
	aux.AddSynchroProcedure(c, nil, aux.NonTuner(nil), 1)
	c:EnableReviveLimit()
	--special summon
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
	e1:SetProperty(EFFECT_FLAG_DELAY)
	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
	e1:SetCountLimit(1, id)
	e1:SetCondition(s.spcon)
	e1:SetTarget(s.sptg)
	e1:SetOperation(s.spop)
	c:RegisterEffect(e1)
	--Destroy
	local e2 = Effect.CreateEffect(c)
	e2:SetDescription(aux.Stringid(id, 1))
	e2:SetCategory(CATEGORY_DESTROY)
	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
	e2:SetCountLimit(1, id + 1)
	e2:SetCode(EVENT_DAMAGE_STEP_END)
	e2:SetCondition(s.descon)
	e2:SetTarget(s.destg)
	e2:SetOperation(s.desop)
	c:RegisterEffect(e2)
	local e3 = e2:Clone()
	e3:SetRange(LOCATION_MZONE)
	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
	e3:SetCondition(s.descon2)
	c:RegisterEffect(e3)
end
function s.spcon(e, tp, eg, ep, ev, re, r, rp)
	return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function s.spfilter(c, e, tp)
	return (c:IsLocation(LOCATION_HAND) or c:IsFaceup())
		and c:IsType(TYPE_PENDULUM)
		and c:IsLevelBelow(4)
		and c:IsCanBeSpecialSummoned(e, 0, tp, false, false, POS_FACEUP)
		and (c:IsLocation(LOCATION_HAND) and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 or c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp, tp, nil, c) > 0)
end
function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_HAND + LOCATION_EXTRA, 0, 1, nil, e, tp)
	end
	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_HAND + LOCATION_EXTRA)
end
function s.spop(e, tp, eg, ep, ev, re, r, rp)
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
	local g = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_HAND + LOCATION_EXTRA, 0, 1, 1, nil, e, tp)
	if g:GetCount() > 0 then
		Duel.SpecialSummon(g, 0, tp, tp, false, false, POS_FACEUP)
	end
end
function s.descon(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	local bc = c:GetBattleTarget()
	e:SetLabelObject(bc)
	return aux.dsercon(e, tp, eg, ep, ev, re, r, rp) and bc and bc:IsRelateToBattle() and bc:IsOnField() and c:IsStatus(STATUS_OPPO_BATTLE)
end
function s.descon2(e, tp, eg, ep, ev, re, r, rp)
	local tc, bc = Duel.GetBattleMonster(tp)
	e:SetLabelObject(bc)
	return tc and bc and tc:IsStatus(STATUS_OPPO_BATTLE) and bc:IsOnField() and bc:IsRelateToBattle() and tc:IsFaceup() and tc:IsType(TYPE_PENDULUM)
end
function s.destg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return true
	end
	Duel.SetOperationInfo(0, CATEGORY_DESTROY, e:GetLabelObject(), 1, 0, 0)
end
function s.desop(e, tp, eg, ep, ev, re, r, rp)
	local bc = e:GetLabelObject()
	if bc:IsRelateToBattle() and bc:IsControler(1 - tp) then
		Duel.Destroy(bc, REASON_EFFECT)
	end
end

