Ir para conteúdo
  • 0

<eof> expected near end


Daezzyr

Pergunta

faz um tempo que eu estou tentando descobrir oque exatamente é esse erro, e eu ainda não consegui arruma-lo, alguém pode me ajudar ?

 

o erro da nessa script :

 

 

local remove_time = 7 -- tempo em segundos para remover as magic wall
local item_id = 1499 -- id da magic wall

function onCastSpell(cid, var)
local storage = 23001
local spellname = "prision"
local time = 10

if exhaustion.check(cid, storage) == false then
exhaustion.set(cid, storage, time)
else
doPlayerSendCancel(cid, "Wait "..time.." seconds to use "..spellname.." again.")
end
end


local pos = getThingPosition(getCreatureTarget(cid))
posTile1 = {x=pos.x+1,y=pos.y+1,z=pos.z,stackpos=1}
posTile2 = {x=pos.x+1,y=pos.y,z=pos.z,stackpos=1}
posTile3 = {x=pos.x+1,y=pos.y-1,z=pos.z,stackpos=1}
posTile4 = {x=pos.x,y=pos.y-1,z=pos.z,stackpos=1}
posTile5 = {x=pos.x-1,y=pos.y-1,z=pos.z,stackpos=1}
posTile6 = {x=pos.x-1,y=pos.y,z=pos.z,stackpos=1}
posTile7 = {x=pos.x-1,y=pos.y+1,z=pos.z,stackpos=1}
posTile8 = {x=pos.x,y=pos.y+1,z=pos.z,stackpos=1}
posAll = {posTile1,posTile2,posTile3,posTile4,posTile5,posTile6,posTile7,posTile8}

for i=1, #posAll do
if isWalkable(posAll) then
doCreateItem(item_id, 1, posAll)
end
end
addEvent(removeItem, remove_time*1000, posAll)

return false
end

function isWalkable(pos, creature, pz, proj)
if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end
local creature = getTopCreature(pos)
if creature.type > 0 then
return false
end
if getTilePzInfo(pos) and not pz then return false end
local n = not proj and 3 or 2
for i = 0, 255 do
pos.stackpos = i
local tile = getTileThingByPos(pos)
if tile.itemid ~= 0 and not isCreature(tile.uid) then
if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then
return false
end
end
end
return true
end

function removeItem(posAll)
for i=1, #posAll do
for j=0, 255 do
pos_stack = {x=posAll.x,y=posAll.y,z=posAll.z,stackpos=j}
removeTile = getThingfromPos(pos_stack)
if removeTile.itemid == item_id then
doRemoveItem(removeTile.uid)
end
end
end
end

 

 

 

 

e o erro é :

 

 

[17/03/2014 19:37:10] [Error - LuaScriptInterface::loadFile] data/spells/scripts/druid/prision.lua:36: '<eof>' expected near 'end'
[17/03/2014 19:37:10] [Warning - Event::loadScript] Cannot load script (data/spells/scripts/druid/prision.lua)
[17/03/2014 19:37:10] data/spells/scripts/druid/prision.lua:36: '<eof>' expected near 'end'

 

 

 

ajudaa pfvr :/

Link para o comentário
Compartilhar em outros sites

7 respostass a esta questão

Posts Recomendados

  • 0

o end e usado para fechar uma função, tente assim:

 

 

 

local remove_time = 7 -- tempo em segundos para remover as magic wall
local item_id = 1499 -- id da magic wall
function onCastSpell(cid, var)
    local storage = 23001
    local spellname = "prision"
    local time = 10
        if exhaustion.check(cid, storage) == false then
                exhaustion.set(cid, storage, time)
        else
                doPlayerSendCancel(cid, "Wait "..time.." seconds to use "..spellname.." again.")
        end
end

local pos = getThingPosition(getCreatureTarget(cid))
posTile1 = {x=pos.x+1,y=pos.y+1,z=pos.z,stackpos=1}
posTile2 = {x=pos.x+1,y=pos.y,z=pos.z,stackpos=1}
posTile3 = {x=pos.x+1,y=pos.y-1,z=pos.z,stackpos=1}
posTile4 = {x=pos.x,y=pos.y-1,z=pos.z,stackpos=1}
posTile5 = {x=pos.x-1,y=pos.y-1,z=pos.z,stackpos=1}
posTile6 = {x=pos.x-1,y=pos.y,z=pos.z,stackpos=1}
posTile7 = {x=pos.x-1,y=pos.y+1,z=pos.z,stackpos=1}
posTile8 = {x=pos.x,y=pos.y+1,z=pos.z,stackpos=1}
posAll = {posTile1,posTile2,posTile3,posTile4,posTile5,posTile6,posTile7,posTile8}
for i=1, #posAll do
    if isWalkable(posAll[i]) then
        doCreateItem(item_id, 1, posAll[i])
    end
addEvent(removeItem, remove_time*1000, posAll)
return false
end
function isWalkable(pos, creature, pz, proj)
    if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end
    local creature = getTopCreature(pos)
    if creature.type > 0 then   
    return false
    end
    if getTilePzInfo(pos) and not pz then return false end
    local n = not proj and 3 or 2
    for i = 0, 255 do
        pos.stackpos = i
        local tile = getTileThingByPos(pos)
        if tile.itemid ~= 0 and not isCreature(tile.uid) then
            if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then
                return false
            end
        end
    end
return true
end
function removeItem(posAll)
    for i=1, #posAll do
        for j=0, 255 do
            pos_stack = {x=posAll[i].x,y=posAll[i].y,z=posAll[i].z,stackpos=j}
            removeTile = getThingfromPos(pos_stack)
            if removeTile.itemid == item_id then
                doRemoveItem(removeTile.uid)
            end
        end
    end
end

 

 

Link para o comentário
Compartilhar em outros sites

  • 0

aqle erro lá n deu n, mas agr deu esses 3

 

 

 

[17/03/2014 19:47:37] [Error - Spell Interface]
[17/03/2014 19:47:37] data/spells/scripts/druid/prision.lua
[17/03/2014 19:47:37] Description:
[17/03/2014 19:47:37] (luaGetCreatureTarget) Creature not found

[17/03/2014 19:47:37] [Error - Spell Interface]
[17/03/2014 19:47:37] data/spells/scripts/druid/prision.lua
[17/03/2014 19:47:37] Description:
[17/03/2014 19:47:37] (luaGetThingPosition) Thing not found

[17/03/2014 19:47:37] [Error - Spell Interface]
[17/03/2014 19:47:37] data/spells/scripts/druid/prision.lua
[17/03/2014 19:47:37] Description:
[17/03/2014 19:47:37] data/spells/scripts/druid/prision.lua:15: attempt to index local 'pos' (a boolean value)
[17/03/2014 19:47:37] [Warning - Event::loadScript] Cannot load script (data/spells/scripts/druid/prision.lua)

 

 

 

Link para o comentário
Compartilhar em outros sites

  • 0

 

 


local remove_time = 7 -- tempo em segundos para remover as magic wall
local item_id = 1499 -- id da magic wall

function onCastSpell(cid, var)
    local storage = 23001
    local spellname = "prision"
    local time = 10

        if exhaustion.check(cid, storage) == false then
                exhaustion.set(cid, storage, time)
        else
                doPlayerSendCancel(cid, "Wait "..time.." seconds to use "..spellname.." again.")
        end


local pos = getThingPosition(getCreatureTarget(cid))
posTile1 = {x=pos.x+1,y=pos.y+1,z=pos.z,stackpos=1}
posTile2 = {x=pos.x+1,y=pos.y,z=pos.z,stackpos=1}
posTile3 = {x=pos.x+1,y=pos.y-1,z=pos.z,stackpos=1}
posTile4 = {x=pos.x,y=pos.y-1,z=pos.z,stackpos=1}
posTile5 = {x=pos.x-1,y=pos.y-1,z=pos.z,stackpos=1}
posTile6 = {x=pos.x-1,y=pos.y,z=pos.z,stackpos=1}
posTile7 = {x=pos.x-1,y=pos.y+1,z=pos.z,stackpos=1}
posTile8 = {x=pos.x,y=pos.y+1,z=pos.z,stackpos=1}
posAll = {posTile1,posTile2,posTile3,posTile4,posTile5,posTile6,posTile7,posTile8}

for i=1, #posAll do
    if isWalkable(posAll[i]) then
        doCreateItem(item_id, 1, posAll[i])
    end
end
addEvent(removeItem, remove_time*1000, posAll)

return false
end

function isWalkable(pos, creature, pz, proj)
    if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end
    local creature = getTopCreature(pos)
    if creature.type > 0 then    
    return false
    end
    if getTilePzInfo(pos) and not pz then return false end
    local n = not proj and 3 or 2
    for i = 0, 255 do
        pos.stackpos = i
        local tile = getTileThingByPos(pos)
        if tile.itemid ~= 0 and not isCreature(tile.uid) then
            if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then
                return false
            end
        end
    end
return true
end

function removeItem(posAll)
    for i=1, #posAll do
        for j=0, 255 do
            pos_stack = {x=posAll[i].x,y=posAll[i].y,z=posAll[i].z,stackpos=j}
            removeTile = getThingfromPos(pos_stack)
            if removeTile.itemid == item_id then
                doRemoveItem(removeTile.uid)
            end
        end
    end
end

 

 

 

eof = end of function

Link para o comentário
Compartilhar em outros sites

  • 0

Eu me limitei a resolver o erro que vc havia falado. Aqui ela está com o exhaust arrumado:


local remove_time = 7 -- tempo em segundos para remover as magic wall
local item_id = 1499 -- id da magic wall

function onCastSpell(cid, var)
    local storage = 23001
    local spellname = "prision"
    local time = 10

        if exhaustion.check(cid, storage) then
            doPlayerSendCancel(cid, "Wait "..time.." seconds to use "..spellname.." again.")
            return false
        end                

local pos = getThingPosition(getCreatureTarget(cid))
posTile1 = {x=pos.x+1,y=pos.y+1,z=pos.z,stackpos=1}
posTile2 = {x=pos.x+1,y=pos.y,z=pos.z,stackpos=1}
posTile3 = {x=pos.x+1,y=pos.y-1,z=pos.z,stackpos=1}
posTile4 = {x=pos.x,y=pos.y-1,z=pos.z,stackpos=1}
posTile5 = {x=pos.x-1,y=pos.y-1,z=pos.z,stackpos=1}
posTile6 = {x=pos.x-1,y=pos.y,z=pos.z,stackpos=1}
posTile7 = {x=pos.x-1,y=pos.y+1,z=pos.z,stackpos=1}
posTile8 = {x=pos.x,y=pos.y+1,z=pos.z,stackpos=1}
posAll = {posTile1,posTile2,posTile3,posTile4,posTile5,posTile6,posTile7,posTile8}

for i=1, #posAll do
    if isWalkable(posAll[i]) then
        doCreateItem(item_id, 1, posAll[i])
    end
end
addEvent(removeItem, remove_time*1000, posAll)
exhaustion.set(cid, storage, time)

return true
end

function isWalkable(pos, creature, pz, proj)
    if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end
    local creature = getTopCreature(pos)
    if creature.type > 0 then    
    return false
    end
    if getTilePzInfo(pos) and not pz then return false end
    local n = not proj and 3 or 2
    for i = 0, 255 do
        pos.stackpos = i
        local tile = getTileThingByPos(pos)
        if tile.itemid ~= 0 and not isCreature(tile.uid) then
            if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then
                return false
            end
        end
    end
return true
end

function removeItem(posAll)
    for i=1, #posAll do
        for j=0, 255 do
            pos_stack = {x=posAll[i].x,y=posAll[i].y,z=posAll[i].z,stackpos=j}
            removeTile = getThingfromPos(pos_stack)
            if removeTile.itemid == item_id then
                doRemoveItem(removeTile.uid)
            end
        end
    end
end
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...