2015-11-10 38 views
-3

您好我是新來Lua和我不斷收到腳本錯誤 誤差Lua的錯誤問題

67:預期(收於38行功能)附近EOF

這裏「端」是代碼,Agian我在鎏任何幫助將apreciated

function c123456708.initial_effect(c) 
    --special summon 
local e1=Effect.CreateEffect(c) 
    e1:SetDescription(aux.Stringid(123456708,0)) 
    e1:SetCategory(CATEGORY_SPECIAL_SUMMON) 
    e1:SetType(EFFECT_TYPE_IGNITION) 
    e1:SetRange(LOCATION_HAND) 
    e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) 
    e1:SetCost(c123456708.spcost) 
    e1:SetTarget(c123456708.sptg) 
    e1:SetOperation(c123456708.spop) 
    c:RegisterEffect(e1) 
local e2=Effect.CreateEffect(c) 
    e2:SetDescription(aux.Stringid(123456708,0)) 
    e2:SetCategory(CATEGORY_TOHAND) 
    e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) 
    e2:SetProperty(EFFECT_FLAG_CARD_TARGET) 
    e2:SetCode(EVENT_SPSUMMON_SUCCESS) 
    e2:SetCondition(c123456708.thcon) 
    e2:SetTarget(c123456708.thtg) 
    e2:SetOperation(c123456708.thop) 
    c:RegisterEffect(e2) 
end 
    function c123456708.cfilter(c) 
    return c:IsFaceup() and c:GetCode()==123456709 
end 
    function c123456708.spcost(e,tp,eg,ep,ev,re,r,rp,chk) 
    if chk==0 then return   Duel.CheckReleaseGroup(tp,c123456708.cfilter,1,nil) end 
    local g=Duel.SelectReleaseGroup(tp,c123456708.cfilter,1,1,nil) 
    Duel.Release(g,REASON_COST) 
end 
    function c123456708.sptg(e,tp,eg,ep,ev,re,r,rp,chk) 
    if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 
     and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end 
    Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) 
end 
function c123456708.spop(e,tp,eg,ep,ev,re,r,rp) 
    if e:GetHandler():IsRelateToEffect(e) then 
    Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP) 
end 
end 
function c123456708.spcon(e,c) 
    if c==nil then return true end 
    local tp=c:GetControler() 
    return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 
     and Duel.IsExistingMatchingCard(c123456708.cfilter,tp,0,LOCATION_MZONE,1,nil) 
end 
function c123456708.thcon(e,tp,eg,ep,ev,re,r,rp) 
    return e:GetHandler():IsPreviousLocation(LOCATION_HAND) 
end 
function c123456708.thfilter(c) 
    return c:IsType(TYPE_SPELL+TYPE_TRAP+TYPE_MONSTER) and c:IsAbleToHand(11) 
end 
function c123456708.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) 
    if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and c123456708.thfilter(chkc) end 
    if chk==0 then return true end 
    Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) 
    local g=Duel.SelectTarget(tp,c123456708.thfilter,tp,0,LOCATION_ONFIELD,1,1,nil) 
    Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0) 
end 
function c123456708.thop(e,tp,eg,ep,ev,re,r,rp) 
    local tc=Duel.GetFirstTarget() 
    if tc and tc:IsRelateToEffect(e) then 
     Duel.SendtoHand(tc,nil,REASON_EFFECT) 
    end 
end 

IM srry如果是通過

加一姐代碼IM上午剛開進行篩選麻煩很新克atempt索引全局c50140163零值 代碼是

function c123456709.initial_effect(c) 
--equip 
local e1=Effect.CreateEffect(c) 
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) 
e1:SetCode(EVENT_SPSUMMON_SUCCESS) 
e1:SetOperation(c123456709.regop) 
c:RegisterEffect(e1) 
end 
c123456709.lvupcount=1 
c123456709.lvup={123456707} 
c123456709.lvdncount=2 
c123456709.lvdn={123456707,123456706} 
function c123456709.regop(e,tp,eg,ep,ev,re,r,rp) 
local c=e:GetHandler() 
if c:GetSummonType()==SUMMON_TYPE_SPECIAL+1 then 
    local e1=Effect.CreateEffect(c) 
    e1:SetDescription(aux.Stringid(123456709,0)) 
    e1:SetCategory(CATEGORY_EQUIP) 
    e1:SetType(EFFECT_TYPE_IGNITION) 
    e1:SetProperty(EFFECT_FLAG_CARD_TARGET) 
    e1:SetRange(LOCATION_MZONE) 
    e1:SetCountLimit(1) 
    e1:SetCondition(c123456709.eqcon) 
    e1:SetTarget(c123456709.eqtg) 
    e1:SetOperation(c123456709.eqop) 
    e1:SetReset(RESET_EVENT+0x1ff0000) 
    e1:SetLabelObject(e) 
    c:RegisterEffect(e1) 
    end 
    end 
    function c123456709.eqcon(e,tp,eg,ep,ev,re,r,rp) 
    local ec=e:GetLabelObject():GetLabelObject() 
    return ec==nil or ec:GetFlagEffect(123456709)==0 
    end 
    function c123456709.filter(c) 
    return c:IsAbleToChangeControler() 
    end 
    function c123456709.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) 
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1- tp) and c123456709.filter(chkc) end 
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 
    and Duel.IsExistingTarget(c123456709.filter,tp,0,LOCATION_MZONE,1,nil)    end 
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) 
local g=Duel.SelectTarget(tp,c123456709.filter,tp,0,LOCATION_MZONE,1,1,nil) 
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0) 
end 
function c123456709.eqlimit(e,c) 
return e:GetOwner()==c and not c:IsDisabled() 
end 
function c123456709.eqop(e,tp,eg,ep,ev,re,r,rp) 
local c=e:GetHandler() 
local tc=Duel.GetFirstTarget() 
if tc:IsRelateToEffect(e) then 
    if c:IsFaceup() and c:IsRelateToEffect(e) then 
     local atk=tc:GetTextAttack() 
     local def=tc:GetTextDefence() 
     if atk<0 then atk=0 end 
     if def<0 then def=0 end 
     if not Duel.Equip(tp,tc,c,false) then return end 
     --Add Equip limit 
     tc:RegisterFlagEffect(123456709,RESET_EVENT+0x1fe0000,0,0) 
     e:GetLabelObject():SetLabelObject(tc) 
     local e1=Effect.CreateEffect(c) 
     e1:SetType(EFFECT_TYPE_SINGLE) 
     e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE) 
     e1:SetCode(EFFECT_EQUIP_LIMIT) 
     e1:SetReset(RESET_EVENT+0x1fe0000) 
     e1:SetValue(c123456709.eqlimit) 
     tc:RegisterEffect(e1) 
     local e2=Effect.CreateEffect(c) 
     e2:SetType(EFFECT_TYPE_EQUIP) 
       e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_OWNER_RELATE+EFFECT_FLAG_SE T_AVAILABLE) 
     e2:SetCode(EFFECT_DESTROY_SUBSTITUTE) 
     e2:SetReset(RESET_EVENT+0x1fe0000) 
     e2:SetValue(c123456709.repval) 
     tc:RegisterEffect(e2) 
    else Duel.SendtoGrave(tc,REASON_EFFECT) end 
    end 
    end 
function c123456709.repval(e,re,r,rp) 
return bit.band(r,REASON_BATTLE)~=0 
end 
+0

aslo我得到一個初始影響錯誤atemp調用錯誤函數? –

+0

也即時通訊獲得另一個錯誤代碼,與一個姊妹代碼是試圖索引全球c50140163倪值代碼是 –

回答

0

兩個代碼段沒有語法錯誤。他們都編譯沒有錯誤(和不執行,因爲我沒有庫),除了一個在下面的語句:

e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_OWNER_RELATE+EFFECT_FLAG_SE T_AVAILABLE) 

,你很可能T_AVAILABLE之前缺少一個逗號(,)。

+0

謝謝,然後hopful它的工作原理 –