a place for all your custom card needs you can post scripts pics and request for card to be made also please donate to the funding for a new server made for custom card duels
 
HomePortalLatest imagesSearchRegisterLog in

Share
 

 Skeleton Warrior - DeeKay Error

View previous topic View next topic Go down 
AuthorMessage
Marc1




Posts : 43
Join date : 2013-08-03

Skeleton Warrior - DeeKay Error Empty
PostSubject: Skeleton Warrior - DeeKay Error   Skeleton Warrior - DeeKay Error Icon_minitimeSun Feb 28, 2016 3:43 am

When this card is sent to the Graveyard; destroy 1 monster on the Field.

I copied Man-Eater Bug code into this but when it goes to the Graveyard, It tries to activate but nothing happens.

Where did I go wrong?


--Skeleton Warrior - DeeKay
function c10550000.initial_effect(c)
--to grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10550000,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetOperation(c10550000.operation)
c:RegisterEffect(e1)
end
function c10550000.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsDestructable() end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c10550000.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
Back to top Go down
Utso

Utso


Member Title : Barnacle Yoghurt
Posts : 6
Join date : 2016-02-21
Age : 27

Skeleton Warrior - DeeKay Error Empty
PostSubject: Re: Skeleton Warrior - DeeKay Error   Skeleton Warrior - DeeKay Error Icon_minitimeSun Feb 28, 2016 11:34 am

Marc1 wrote:
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10550000,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetOperation(c10550000.operation)
c:RegisterEffect(e1)
You forgot to assign the target function to the effect with e1:SetTarget here. Because of that, the operation is called right away and doesn't produce any results because no target has been selected, leading to the described behavior.
Back to top Go down
Marc1




Posts : 43
Join date : 2013-08-03

Skeleton Warrior - DeeKay Error Empty
PostSubject: Re: Skeleton Warrior - DeeKay Error   Skeleton Warrior - DeeKay Error Icon_minitimeSun Feb 28, 2016 7:37 pm

I added e1:SetTarget(c10550000.destg) to the script & it gave me an error with that line.  What did I do wrong?
Back to top Go down
Utso

Utso


Member Title : Barnacle Yoghurt
Posts : 6
Join date : 2016-02-21
Age : 27

Skeleton Warrior - DeeKay Error Empty
PostSubject: Re: Skeleton Warrior - DeeKay Error   Skeleton Warrior - DeeKay Error Icon_minitimeSun Feb 28, 2016 9:07 pm

Isn't the function called c10550000.target and not .destg? Unless you changed it since the initial post.
Back to top Go down
Marc1




Posts : 43
Join date : 2013-08-03

Skeleton Warrior - DeeKay Error Empty
PostSubject: Re: Skeleton Warrior - DeeKay Error   Skeleton Warrior - DeeKay Error Icon_minitimeMon Feb 29, 2016 4:05 am

Thanks, that works! (I don't know how to code. I just copy & paste & hope it works! LOL)
Back to top Go down
StormWing0




Member Title : Over Creative Card Ideas
Posts : 451
Join date : 2013-07-14
Age : 32
Location : Tacoma, WA

Skeleton Warrior - DeeKay Error Empty
PostSubject: Re: Skeleton Warrior - DeeKay Error   Skeleton Warrior - DeeKay Error Icon_minitimeTue Mar 01, 2016 2:00 am

lol at least you are willing to learn unlike some other person on the forum. XD
Back to top Go down
TGAP-Trixie

TGAP-Trixie


Member Title : Trixie does not even...
Posts : 273
Join date : 2014-04-17

Skeleton Warrior - DeeKay Error Empty
PostSubject: Re: Skeleton Warrior - DeeKay Error   Skeleton Warrior - DeeKay Error Icon_minitimeThu Mar 03, 2016 2:31 am

Yup, I started with basic stuff like this too Smile good times. I'm at 300+ scripted cards right now, but I did redo like 50 because they were too basic. Anyways I'll give you rep points cause it's nice to see people actually try instead of just ask requests without trying anything first, not that there's been many people here (just that one guy, I forget his name. I think his location mentions something about living under a bridge)
Back to top Go down
Sponsored content





Skeleton Warrior - DeeKay Error Empty
PostSubject: Re: Skeleton Warrior - DeeKay Error   Skeleton Warrior - DeeKay Error Icon_minitime

Back to top Go down
 

Skeleton Warrior - DeeKay Error

View previous topic View next topic Back to top 
Page 1 of 1

 Similar topics

-
» Script error and a windows error issue!
» Error - 1001
» Error on update
» Warrior Of Light
» LOGIN ERROR

Permissions in this forum:You cannot reply to topics in this forum
Mackpro :: MackPro :: Custom cards - Single cards-