Anti-Spell
Both players must Set Spell Cards before activating them, and cannot activate them until their next turn after Setting them.
local s, id, o = GetID()
function s.initial_effect(c)
	--Activate
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetCode(EVENT_FREE_CHAIN)
	c:RegisterEffect(e1)
	--cannot activate
	local e2 = Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_FIELD)
	e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
	e2:SetCode(EFFECT_CANNOT_ACTIVATE)
	e2:SetRange(LOCATION_SZONE)
	e2:SetTargetRange(1, 1)
	e2:SetValue(s.aclimit)
	c:RegisterEffect(e2)
	local e3 = Effect.CreateEffect(c)
	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
	e3:SetCode(EVENT_SSET)
	e3:SetRange(LOCATION_SZONE)
	e3:SetOperation(s.aclimset)
	c:RegisterEffect(e3)
end
function s.aclimit(e, re, tp)
	if not re:IsHasType(EFFECT_TYPE_ACTIVATE) or not re:IsActiveType(TYPE_SPELL) then
		return false
	end
	local c = re:GetHandler()
	return not c:IsLocation(LOCATION_SZONE) or c:GetFlagEffect(id) > 0
end
function s.aclimset(e, tp, eg, ep, ev, re, r, rp)
	local tc = eg:GetFirst()
	while tc do
		local reset = tc:IsControler(tp) and RESET_OPPO_TURN or RESET_SELF_TURN
		tc:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END + reset, 0, 1)
		tc = eg:GetNext()
	end
end


Anti-Spell
Both players must Set Spell Cards before activating them, and cannot activate them until their next turn after Setting them.
-- Anti-Spell
local s, id, o = GetID()
function s.initial_effect(c)
	--Activate
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetCode(EVENT_FREE_CHAIN)
	c:RegisterEffect(e1)
	--cannot activate
	local e2 = Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_FIELD)
	e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
	e2:SetCode(EFFECT_CANNOT_ACTIVATE)
	e2:SetRange(LOCATION_SZONE)
	e2:SetTargetRange(1, 1)
	e2:SetValue(s.aclimit)
	c:RegisterEffect(e2)
	local e3 = Effect.CreateEffect(c)
	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
	e3:SetCode(EVENT_SSET)
	e3:SetRange(LOCATION_SZONE)
	e3:SetOperation(s.aclimset)
	c:RegisterEffect(e3)
end
function s.aclimit(e, re, tp)
	if not re:IsHasType(EFFECT_TYPE_ACTIVATE) or not re:IsActiveType(TYPE_SPELL) then
		return false
	end
	local c = re:GetHandler()
	return not c:IsLocation(LOCATION_SZONE) or c:GetFlagEffect(id) > 0
end
function s.aclimset(e, tp, eg, ep, ev, re, r, rp)
	local tc = eg:GetFirst()
	while tc do
		local reset = tc:IsControler(tp) and RESET_OPPO_TURN or RESET_SELF_TURN
		tc:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END + reset, 0, 1)
		tc = eg:GetNext()
	end
end

