Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Monsters your opponent controls cannot target face-up "Performapal" monsters for attacks, except this one. If a "Performapal" card(s) you control, except "Performapal Thunderhino", would be destroyed by battle or card effect while this card is in your Graveyard, you can banish this card instead.
--EMジンライノ
--Performapal Thunderhino
local s,id=GetID()
function s.initial_effect(c)
	--Other monsters cannot be targeted by attacks
	local e1=Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_FIELD)
	e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
	e1:SetRange(LOCATION_MZONE)
	e1:SetTargetRange(0,LOCATION_MZONE)
	e1:SetValue(s.atlimit)
	c:RegisterEffect(e1)
	--Destruction replacement for a "Perfomapal" card
	local e2=Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
	e2:SetCode(EFFECT_DESTROY_REPLACE)
	e2:SetRange(LOCATION_GRAVE)
	e2:SetTarget(s.reptg)
	e2:SetValue(s.repval)
	e2:SetOperation(s.repop)
	c:RegisterEffect(e2)
end
s.listed_series={SET_PERFORMAPAL}
s.listed_names={id}
function s.atlimit(e,c)
	return c:IsFaceup() and c:IsSetCard(SET_PERFORMAPAL) and c~=e:GetHandler()
end
function s.repfilter(c,tp)
	return c:IsFaceup() and c:IsSetCard(SET_PERFORMAPAL) and not c:IsCode(id) and c:IsOnField()
		and c:IsControler(tp) and not c:IsReason(REASON_REPLACE) and c:IsReason(REASON_EFFECT|REASON_BATTLE)
end
function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
	local c=e:GetHandler()
	if chk==0 then return c:IsAbleToRemove() and eg:IsExists(s.repfilter,1,nil,tp) end
	return Duel.SelectEffectYesNo(tp,c,96)
end
function s.repval(e,c)
	return s.repfilter(c,e:GetHandlerPlayer())
end
function s.repop(e,tp,eg,ep,ev,re,r,rp)
	Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT|REASON_REPLACE)
end