Jump to content
  • 0

Script help


DM999

Question

I'm trying to script a pendulum monster for an older version of YGOPRO with an effect that says "once per turn, you can add 1 pendulum monster from your deck to your hand, except this card, then destroy 1 card in your pendulum zone", but I'm having some trouble with it. The search went off fine but it won't destroy in my pendulum zone after that. This is what it looks like:

function c(id).thfilter(c)
    return c:IsSetCard(xxxx) and c:IsType(TYPE_PENDULUM) and not c:IsCode(id) and c:IsAbleToHand()
end
function c(id).desfilter(c)
    return (c:GetSequence()==6 or c:GetSequence()==7)
end
function c(id).thtg(e,tp,eg,ep,ev,re,r,rp,chk)
    if chk==0 then return Duel.IsExistingTarget(c(id).desfilter,tp,LOCATION_SZONE,0,1,nil)
        and Duel.IsExistingMatchingCard(c(id).thfilter,tp,LOCATION_DECK,0,1,nil) end
    Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
    Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c(id).thop(e,tp,eg,ep,ev,re,r,rp)
    Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
    local g=Duel.SelectMatchingCard(tp,c(id).thfilter,tp,LOCATION_DECK,0,1,1,nil)
    if g:GetCount()>0 then
        Duel.SendtoHand(g,nil,REASON_EFFECT)
        Duel.ConfirmCards(1-tp,g)
        Duel.ShuffleHand(tp)
        Duel.BreakEffect()
        Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
        local g=Duel.SelectMatchingCard(tp,c(id).desfilter,LOCATION_SZONE,0,1,1,nil)
        if g:GetCount()>0 then
            Duel.Destroy(tc,REASON_EFFECT)
        end
    end
end

Is there something I missed?

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...