Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
When this face-up card you control is selected as an attack target, you can discard 1 "Fabled" monster to negate the attack.
--魔轟神獣ルビィラーダ
--The Fabled Rubyruda
local s,id=GetID()
function s.initial_effect(c)
	--Negate attack
	local e1=Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id,0))
	e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
	e1:SetCode(EVENT_BE_BATTLE_TARGET)
	e1:SetCost(s.cost)
	e1:SetOperation(s.op)
	c:RegisterEffect(e1)
end
s.listed_series={SET_FABLED}
function s.cfilter(c)
	return c:IsSetCard(SET_FABLED) and c:IsMonster() and c:IsDiscardable()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
	if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil) end
	Duel.DiscardHand(tp,s.cfilter,1,1,REASON_COST|REASON_DISCARD)
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
	Duel.NegateAttack()
end