YGOPRO Forum

Welcome Guest! To enable all features please try to register or login.
Options
Go to last post Go to first unread
smoke911  
#1 Posted : Friday, May 08, 2020 3:22:50 PM(UTC)
smoke911

Rank: Newbie

Joined: 5/8/2020(UTC)
Posts: 2

Thanks: 1 times
I can't load my custom card script but I don't know what's wrong of this script...
please somebody help me

--name
--Overwritten functions
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(s.spcon)
e1:SetCost(s.cost)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(s.adval)
c:RegisterEffect(e2)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:ResetFlagEffect(id)
Duel.SpecialSummon(c,0,tp,tp,false,false)
end
function s.spfilter(c,e,tp)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsAttackAbove(3500)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_MZONE+LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetOperation(s.atkop)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local e2=Effect.CreateEffect(c)
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(1000)
end
Hippocampus1901  
#2 Posted : Monday, May 11, 2020 3:56:47 AM(UTC)
Hippocampus1901

Rank: Advanced Member

Joined: 12/29/2015(UTC)
Posts: 175

Thanks: 11 times
Was thanked: 41 time(s) in 41 post(s)
Hi smoke911, is this all of your script? If so, you're missing quite a few things.

Make sure the line "function s.initial_effect(c)" is toward the top of your script (preferably on your second line, between "--name" and "--Overwritten functions").
Replace the word "spfilter" with "costfilter", as those two should be referencing the same functions.
Next, you need to add the line "c:RegisterEffect(e2)" underneath "e2:SetOperation(s.atkop)" as well as underneath "e2:SetValue(1000)".
Also you need an "end" at the end of your script, because function s.atkop is not closed right now (yes you already have one there but it's for the if statement inside s.atkop, not s.atkop itself!).
Lastly, your function s.adval is not defined anywhere... so you need to add it if you want that part of your card to do anything. If you don't know how to create this from scratch, you should post what your card's effect is so we know what you need to have scripted.

Hope this helps!
thanks 1 user thanked Hippocampus1901 for this useful post.
smoke911  
#3 Posted : Monday, May 11, 2020 7:45:40 AM(UTC)
smoke911

Rank: Newbie

Joined: 5/8/2020(UTC)
Posts: 2

Thanks: 1 times
Originally Posted by: Hippocampus1901 Go to Quoted Post
Hi smoke911, is this all of your script? If so, you're missing quite a few things.

Make sure the line "function s.initial_effect(c)" is toward the top of your script (preferably on your second line, between "--name" and "--Overwritten functions").
Replace the word "spfilter" with "costfilter", as those two should be referencing the same functions.
Next, you need to add the line "c:RegisterEffect(e2)" underneath "e2:SetOperation(s.atkop)" as well as underneath "e2:SetValue(1000)".
Also you need an "end" at the end of your script, because function s.atkop is not closed right now (yes you already have one there but it's for the if statement inside s.atkop, not s.atkop itself!).
Lastly, your function s.adval is not defined anywhere... so you need to add it if you want that part of your card to do anything. If you don't know how to create this from scratch, you should post what your card's effect is so we know what you need to have scripted.

Hope this helps!


thank you so much. this issue has been solved.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Notification

Icon
Error