Jump to content
  • 0

Help with Script.


Pablo.143

Question

I have so much difficulty in make a script for this card, someone cn help me please ? i put all the scripts of the effects but it cannot ask for option, and when a monster is send to pendulum it doesn´t active properly. And i just cant make the negate attack work.

 

[spoiler= The card i want to make]

 

j2epOy8.jpg

 

 

Text: Target 1 ''Green Parrotman-F.D'' you control, if i battles an opponent's monster this turn while you control ir, apply on of these effect:

 When ''Green Parrotman-F.D''  destroy a monster by battle, inflict battle damege 300 x Level of ''Green Parrotman-F.D'' .

When an opponent's monster declares an attack: Target the attacking monster: negate attack, then end the Battle Phase

Destroy all monsters with the Level or Rank equal or below of the ''Green Parrotman-F.D'' .

 

 

 

 [spoiler=Script]

function c90000014.initial_effect©
--Activate
local e1=Effect.CreateEffect©
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetTarget(c90000014.target)
e1:SetOperation(c90000014.activate)
c:RegisterEffect(e1)
--Activate
end
 
--filter
function c90000014.filter©
return c:IsFaceup() and c:IsCode(90000001)
end
 
function c90000014.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c90000014.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c90000014.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c90000014.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c90000014.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and not tc:IsImmuneToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(90000014,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetCondition(c90000014.damcon)
        e1:SetTarget(c90000014.damtg)
    e1:SetOperation(c90000014.damop)
e1:SetReset(RESET_EVENT+0x1620000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
---dano de ataque target
function c90000014.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tc=e:GetHandler()
local dam=tc:GetLevel()*300
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(dam)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
end
--dano de ataque condi
function c90000014.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return c:IsRelateToBattle() and bc:IsLocation(LOCATION_GRAVE) and bc:IsReason(REASON_BATTLE) and bc:IsType(TYPE_MONSTER)
end
--dano de ataque op
function c90000014.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  On 10/14/2016 at 10:24 AM, Sakura Haruno said:

For future reference, if you have any coding issues, refer to the YGOPro forum inside of Advanced Cards.

 

Have you tried copy/pasting from existing cards that do similar things?

Yes, i also tried to find the script of action cards but i did not  find any lol,

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Guest
This topic is now closed to further replies.
×
×
  • Create New...