My card reads as such:
When this card is targeted for an attack: You can Special Summon one "___ Token" (Warrior-Type/DARK/Level 3/ATK 0/DEF 0); Change the attack target to another monster you control. The ATK and DEF of the "___ Token" are equal to half the attacking monster's ATK. When a Token you control is destroyed by battle, this card gains ATK equal to the Token's ATK.
I've been borrowing lines of code from other cards (specifically "Caam, Serenity of Gusto", "Battlin' Boxer Glassjaw", and some "Mecha Phantom Beast" monster).
Right now, my code looks like this:
function c50020004.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_BE_BATTLE_TARGET)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c50020004.cost)
c:RegisterEffect(e1)
end
function c50020004.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if Duel.IsPlayerCanSpecialSummonMonster(tp,31533705,0x0,0x0,0,0,3,RACE_WARRIOR,ATTRIBUTE_DARK) then
local token=Duel.CreateToken(tp,67922703)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end
end
When my monster is summoned, YGOPRO tells me:
15: Action is not allowed here.
Line 15 being:
local token=Duel.CreateToken(tp,67922703)
What can I do to fix this?
Edited by user
2014-04-26T20:47:16Z
|
Reason: Not specified