Ir para conteúdo

Na Hora De Abrir O Ot


Cnic

Posts Recomendados

galera,na hora de abrir o ot... aparece isso

 

[13/12/2009 15:17:14] [Error - LuaScriptInterface::loadFile] data/actions/scripts/chest02.lua:3: 'end' expected (to close 'function' at line 1) near 'elseif'

[13/12/2009 15:17:14] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/chest02.lua)

 

Script aqui

function onUse(cid, item, frompos, item2, topos)

 

elseif item.uid == 1002 then

queststatus = getPlayerStorageValue(cid,1002)

if queststatus == -1 then

if getPlayerFreeCap(cid) >= 50.00 then

doPlayerSendTextMessage(cid,22,"You found a Backpack With Weapon Set.")

container = doPlayerAddItem(cid, 1988, 1)

doAddContainerItem(container, 8601, 1)

doAddContainerItem(container, 2383, 1)

doAddContainerItem(container, 2190, 1)

doAddContainerItem(container, 2456, 1)

doAddContainerItem(container, 2544, 1)

setPlayerStorageValue(cid,1002,1)

else

doPlayerSendTextMessage(cid,22,"You have found a Backpack With Weapon Set. Weighing 50.00 oz it is too heavy.")

end

else

doPlayerSendTextMessage(cid,22,"The chest is empty.")

end

return 0

end

return 1

end

 

Uq eu faço

 

ou este erro tb

 

09 15:17:14] [Error - LuaScriptInterface::loadFile] data/actions/scripts/leveldoor.lua:46: ')' expected near 'passar'

[13/12/2009 15:17:14] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/leveldoor.lua)

function onUse(cid, item, frompos, item2, topos)

 

if getPlayerLevel(cid) >= item.actionid - 1000 then

 

doTransformItem(item.uid, item.itemid + 1)

 

playerpos = getPlayerPosition(cid)

 

doorpos = {x = frompos.x, y = frompos.y, z = frompos.z, stackpos = 253}

 

if playerpos.y == doorpos.y + 1 and playerpos.x == doorpos.x then

 

doMoveCreature(cid, 0)

 

elseif playerpos.x == doorpos.x - 1 and playerpos.y == doorpos.y then

 

doMoveCreature(cid, 1)

 

elseif playerpos.y == doorpos.y - 1 and playerpos.x == doorpos.x then

 

doMoveCreature(cid, 2)

 

elseif playerpos.y == doorpos.y and playerpos.x == doorpos.x + 1 then

 

doMoveCreature(cid, 3)

 

elseif playerpos.x == doorpos.x + 1 and playerpos.y == doorpos.y - 1 then

 

doMoveCreature(cid, 4)

 

elseif playerpos.x == doorpos.x - 1 and playerpos.y == doorpos.y - 1 then

 

doMoveCreature(cid, 5)

 

elseif playerpos.x == doorpos.x + 1 and playerpos.y == doorpos.y + 1 then

 

doMoveCreature(cid, 6)

 

elseif playerpos.x == doorpos.x - 1 and playerpos.y == doorpos.y + 1 then

 

doMoveCreature(cid, 7)

 

end

 

else

doPlayerSendTextMessage(cid, 22, "Você precisa estar no level"..(item.actionid - 1000)..para passar nesta porta" .")

 

end

 

return 1

 

end

 

Link para o comentário
Compartilhar em outros sites

O primeiro script ta errado pq não pode ser elseif e sim if.

Fiz uma modificação, ve se funciona:

local items = {8601, 2383, 2190, 2456, 2544}

function onUse(cid, item, frompos, item2, topos)
    if item.uid == 1002 then
        queststatus = getPlayerStorageValue(cid,1002)
        if queststatus == -1 then
            if getPlayerFreeCap(cid) >= 50.00 then
                doPlayerSendTextMessage(cid,22,"You found a Backpack With Weapon Set.")
                container = doPlayerAddItem(cid, 1988, 1)
                for i, item in ipairs(items) do
                    doAddContainerItem(container, item, 1)
                end
                setPlayerStorageValue(cid,1002,1)
            else
                doPlayerSendTextMessage(cid,22,"You have found a Backpack With Weapon Set. Weighing 50.00 oz it is too heavy.")
            end
        else
            doPlayerSendTextMessage(cid,22,"The chest is empty.")
        end
    end
    return TRUE
end

 

Ja o segundo vc errou uma ".

Troca:

doPlayerSendTextMessage(cid, 22, "Você precisa estar no level"..(item.actionid - 1000)..para passar nesta porta" .")

Por:

doPlayerSendTextMessage(cid, 22, "Você precisa estar no level "..(item.actionid - 1000).." para passar nesta porta.")

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...