Well, 511009517 is the card number of Supreme King Servant Dragon Clear Wing. So if you don't intend to change the script of that card, you need to replace all 511009517 with the card ID of your custom card.
Ok im trying to have the same kind of effect, but with 2 Differrences:
My Monster is a effect Monster =location Deck not Extra Deck
And instead of summon 2 supreme pendulum dragon i want to summon 2 effect Monster of my own archetyp
(setcode 600)
but it doesnt work:
--spsummon
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(95923441,0))
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetHintTiming(0,TIMING_END_PHASE)
e5:SetRange(LOCATION_MZONE)
e5:SetCost(c136.spcost)
e5:SetTarget(c136.sptg)
e5:SetOperation(c136.spop2)
c:RegisterEffect(e5)
end
function c136.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end
Duel.SendtoDeck(e:GetHandler(),nil,0,REASON_COST)
end
function c136.spfilter2(c,e,tp)
return c:IsFaceup() and c:IsSetCard(600) and c:IsType(TYPE_EFFECT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c136.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and e:GetHandler():GetFlagEffect(136)==0
and Duel.IsExistingMatchingCard(c136.spfilter2,tp,LOCATION_DECK,0,2,nil,e,tp) end
e:GetHandler():RegisterFlagEffect(136,RESET_CHAIN,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK)
end
function c136.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) or Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local g=Duel.GetMatchingGroup(c136.spfilter2,tp,LOCATION_DECK,0,nil,e,tp)
if g:GetCount()>=2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,2,2,nil)
if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)==0 then return end
local ag=Duel.GetMatchingGroup(c136.filter,tp,0,LOCATION_MZONE,nil)
local tc=ag:GetFirst()
while tc do
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_ATTACK_FINAL)
e2:SetValue(0)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
tc=ag:GetNext()
end
end
end