ha_n
  • ha_n
  • Advanced Member Topic Starter
2015-12-22T01:52:40Z
Can anyone help me this effect [:laugh:]
"You can detach 1 Xyz Material from this card; detach all Xyz Materials from monsters your opponent controls and destroy all monster opponent control"
This effect I have written

local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetDescription(aux.Stringid(50,1))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c50.atcost)
e1:SetTarget(c50.attg)
e1:SetOperation(c50.atop)
c:RegisterEffect(e1)
end.

function c50.atcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c50.attg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetOverlayCount(tp,0,1)~=0 end
end
function c50.atop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetOverlayGroup(tp,0,1)
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
if g:GetCount()~=0 then
Duel.SendtoGrave(g,REASON_DESTROY)
end

I have tried script it but when i used nothing happen.[:sad:]
Please help me fix this effect [:cry:] thank you so much[:lol:]
ha_n
  • ha_n
  • Advanced Member Topic Starter
2015-12-23T02:10:24Z
Please help me[:wall:]
[YOL]Edo9300
2015-12-23T20:40:07Z
You can use Neo galaxy eyes photon Dragon's effect
ha_n
  • ha_n
  • Advanced Member Topic Starter
2015-12-24T08:21:43Z
I have tried but nothing happen. Can you fix it ? Thanks
I don't know combine 2 effect (detach all xyz material and destroy) into 1[:sad:]
[YOL]Edo9300
2015-12-24T09:34:40Z
Ok I'll see it after holidays [:smile:]
ha_n
  • ha_n
  • Advanced Member Topic Starter
2015-12-24T13:56:55Z
Thank for your help.
JohnnyR3dd
2015-12-24T23:10:09Z
hi, i do it in 2 way
first, how you ask with ignition
secon a little over power[:thumbu:]

first
function c20000001.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,4,1)
c:EnableReviveLimit()
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetDescription(aux.Stringid(39272762,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,0x1e0)
e3:SetCost(c20000001.atcost)

e3:SetOperation(c20000001.operation)
c:RegisterEffect(e3)

end

function c20000001.atcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c20000001.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsDestructable()
end
function c20000001.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetOverlayGroup(tp,0,1)
c:IsRelateToEffect(e)
g:GetCount()
Duel.SendtoGrave(g,REASON_EFFECT)--send xyz material to grave
local g=Duel.GetMatchingGroup(c20000001.filter,tp,0,LOCATION_ONFIELD,nil)
Duel.Destroy(g,REASON_EFFECT)
end

function c20000001.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,4,1)
c:EnableReviveLimit()

local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetDescription(aux.Stringid(39272762,1))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,0x1e0)
e3:SetCost(c20000001.atcost)

e3:SetOperation(c20000001.operation)
c:RegisterEffect(e3)

end

function c20000001.atcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end

function c20000001.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsDestructable()
end
function c20000001.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetOverlayGroup(tp,0,1)
c:IsRelateToEffect(e)
g:GetCount()
Duel.Overlay(e:GetHandler(),g)--in più
local g=Duel.GetMatchingGroup(c20000001.filter,tp,0,LOCATION_ONFIELD,nil)
Duel.Destroy(g,REASON_EFFECT)
end
--With great power comes great responsibility
ha_n
  • ha_n
  • Advanced Member Topic Starter
2015-12-25T02:26:09Z
Thanks you so much,[:love:] i really need this scripts [:laugh:] . I will try it[:thumbu:]
Can you explain where "c20000001.discon" and "c20000001.attg"? I don't see it in local e1[:tongue:]
JohnnyR3dd
2015-12-25T17:43:25Z
"c20000001.discon" and "c20000001.attg"
is old function, you can delete, the main function don't use that.
ha_n
  • ha_n
  • Advanced Member Topic Starter
2015-12-26T03:08:14Z
Oh thanks you [:w00t:] . Can you help me way to combine many effects into 1 as this script?[:laugh:]
Sorry because i have asked too much and disturbed you.[:blush:]
JohnnyR3dd
2015-12-26T10:09:14Z
when i have time, yes
ha_n
  • ha_n
  • Advanced Member Topic Starter
2015-12-26T13:30:42Z
Originally Posted by: JohnnyR3dd 

when i have time, yes


Yes, thank you to notice this topic and help me[:dance:] . Thank you your script has worked[:laugh:]
Michael Lawrence Dee
2015-12-27T05:30:18Z
Alright. Let me finish this...

EDIT: Done! (?)

--effect
	local e3=Effect.CreateEffect(c)
	e3:SetCategory(CATEGORY_DESTROY)
	e3:SetDescription(aux.Stringid(39272762,1))
	e3:SetType(EFFECT_TYPE_IGNITION)
	e3:SetRange(LOCATION_MZONE)
	e3:SetCost(cXXX.cost)
	e3:SetTarget(cXXX.tg)
	e3:SetOperation(cXXX.op)
	c:RegisterEffect(e3)

function cXXX.cost(e,tp,eg,ep,ev,re,r,rp,chk)
	if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
	e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function cXXX.tg(e,tp,eg,ep,ev,re,r,rp,chk)
	if chk==0 then return Duel.GetOverlayCount(tp,0,1)~=0 
		and Duel.IsExistingMatchingCard(Card.IsDestructable,tp,0,LOCATION_MZONE,1,nil) end
	local sg=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_MZONE,nil)
	Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function cXXX.op(e,tp,eg,ep,ev,re,r,rp)
	local c=e:GetHandler()
	local g=Duel.GetOverlayGroup(tp,0,1)
	if g:GetCount()~=0 then
		Duel.SendtoGrave(g,REASON_EFFECT)
		local sg=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_MZONE,nil)
		Duel.Destroy(sg,REASON_EFFECT)
	end
end

Now this is how I play:
ha_n
  • ha_n
  • Advanced Member Topic Starter
2015-12-27T11:58:28Z
Originally Posted by: Michael Lawrence Dee 

Alright. Let me finish this...

EDIT: Done! (?)

--effect
	local e3=Effect.CreateEffect(c)
	e3:SetCategory(CATEGORY_DESTROY)
	e3:SetDescription(aux.Stringid(39272762,1))
	e3:SetType(EFFECT_TYPE_IGNITION)
	e3:SetRange(LOCATION_MZONE)
	e3:SetCost(cXXX.cost)
	e3:SetTarget(cXXX.tg)
	e3:SetOperation(cXXX.op)
	c:RegisterEffect(e3)

function cXXX.cost(e,tp,eg,ep,ev,re,r,rp,chk)
	if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
	e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function cXXX.tg(e,tp,eg,ep,ev,re,r,rp,chk)
	if chk==0 then return Duel.GetOverlayCount(tp,0,1)~=0 
		and Duel.IsExistingMatchingCard(Card.IsDestructable,tp,0,LOCATION_MZONE,1,nil) end
	local sg=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_MZONE,nil)
	Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function cXXX.op(e,tp,eg,ep,ev,re,r,rp)
	local c=e:GetHandler()
	local g=Duel.GetOverlayGroup(tp,0,1)
	if g:GetCount()~=0 then
		Duel.SendtoGrave(g,REASON_EFFECT)
		local sg=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_MZONE,nil)
		Duel.Destroy(sg,REASON_EFFECT)
	end
end



I had tested this script successfully[:love:] . I don’t know how to express my thanks . I was so pleased because you had noticed and helped me although you was very busy[:laugh:]
ha_n
  • ha_n
  • Advanced Member Topic Starter
2015-12-27T13:41:30Z
Thanks everybody for spending time with me.[:laugh:] There are no words to show my appreciation![:love:]
ha_n
  • ha_n
  • Advanced Member Topic Starter
2016-01-09T02:06:25Z
Can anyone help me? i cann't activate this effect while opponent's field don't have xyz material to detach example as they don't control xyz monster[:wall:] .I tried to change script to this effect can destroy and and detach together but it didn't worked[:sad:]
Please help me fix script to make it can destroy monster even though opponent don't have xyz material attached in their monster. Sincerely thanks[:laugh:]
Michael Lawrence Dee
2016-01-09T05:49:28Z
Originally Posted by: ha_n 

Can anyone help me? i cann't activate this effect while opponent's field don't have xyz material to detach example as they don't control xyz monster[:wall:] .I tried to change script to this effect can destroy and and detach together but it didn't worked[:sad:]
Please help me fix script to make it can destroy monster even though opponent don't have xyz material attached in their monster. Sincerely thanks[:laugh:]



See one of the target functions? return "conditon1" and "conditon2" just remove 1 of those along with the "and".
Now this is how I play:
ha_n
  • ha_n
  • Advanced Member Topic Starter
2016-01-09T07:03:32Z

I changed target function and activated effect but nothing is happen[:tongue:] . Should I change operation function? [:doh:]
Michael Lawrence Dee
2016-01-09T07:08:05Z
Originally Posted by: ha_n 


I changed target function and activated effect but nothing is happen[:tongue:] . Should I change operation function? [:doh:]



First off, by changing that, I think that would remove the checking for opponent's Xyz Materials. Also, make sure you are not in-game.

You don't need to change


Sorry, I rechecked...

function cXXX.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetOverlayGroup(tp,0,1)
if g:GetCount()~=0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
local sg=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(sg,REASON_EFFECT)
end

Here's the modified one. Just move that part out of the if condition.
Now this is how I play:
ha_n
  • ha_n
  • Advanced Member Topic Starter
2016-01-09T08:45:21Z


i have done as you say but it don't still work😅 . i think because "end" what finished the function so i try adding "if" condition again😂. Sorry because i have taken more your time