name: Space
card_text: Detach 1 Xyz Material from a monster.
lua: 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)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.CheckRemoveOverlayCard(tp, 1, 1, 1, REASON_EFFECT)
  	end
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DEATTACHFROM)
  	local sg = Duel.SelectMatchingCard(tp, Card.CheckRemoveOverlayCard, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, nil, tp, 1, REASON_EFFECT)
  	if sg:GetCount() == 0 then
  		return
  	end
  	Duel.HintSelection(sg)
  	sg:GetFirst():RemoveOverlayCard(tp, 1, 1, REASON_EFFECT)
  end
  
  
source_text: Space
  Detach 1 Xyz Material from a monster.
target_text: -- Space
  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)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.CheckRemoveOverlayCard(tp, 1, 1, 1, REASON_EFFECT)
  	end
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DEATTACHFROM)
  	local sg = Duel.SelectMatchingCard(tp, Card.CheckRemoveOverlayCard, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, nil, tp, 1, REASON_EFFECT)
  	if sg:GetCount() == 0 then
  		return
  	end
  	Duel.HintSelection(sg)
  	sg:GetFirst():RemoveOverlayCard(tp, 1, 1, REASON_EFFECT)
  end
  
  