Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
Once per turn, you can either: Target 1 face-up monster you control; equip this card to that target, OR: Unequip this card and Special Summon it in face-up Attack Position. While equipped by this effect, the equipped monster cannot be targeted or destroyed by your opponent's monster effects. (A monster can only be equipped with 1 Union Monster at a time. If the equipped monster would be destroyed by battle, destroy this card instead.)
--メタル化寄生生物－ソルタイト
--Metallizing Parasite - Soltite
local s,id=GetID()
function s.initial_effect(c)
	aux.AddUnionProcedure(c,nil,true)
	--Equip effect
	local e1=Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_EQUIP)
	e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
	e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
	e1:SetCondition(aux.IsUnionState)
	e1:SetValue(s.efilter1)
	c:RegisterEffect(e1)
	local e2=Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_EQUIP)
	e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
	e2:SetCondition(aux.IsUnionState)
	e2:SetValue(s.efilter2)
	c:RegisterEffect(e2)
end
function s.efilter1(e,re,rp)
	return rp==1-e:GetHandlerPlayer() and re:IsMonsterEffect()
end
function s.efilter2(e,te)
	return te:GetHandlerPlayer()~=e:GetHandlerPlayer() and te:IsMonsterEffect()
end