FL
pedido

SCRIPT TELEPORT COM BATLE E SEM SKULL

Por flagoa, 01 de mai. de 2013 em Scripts

script
8
1.9k
flagoaF
01 de maio de 2013 às 00:01

Como faço um script para criar um item que teleporta o player para o templo, o player pode estar com batle, mas não pode estar com white skull, red ou black? Vi um tópico do Roksas e tentei algo assim:

 

 

data/actions/scripts

 

 

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

if getCreatureCondition(cid,CONDITION_INFIGHT) == TRUE then

if getCreatureCondition(cid,CONDITION_SKULL_WHITE) == FALSE then

if getCreatureCondition(cid,CONDITION_SKULL_BLACK) == FALSE then

if getCreatureCondition(cid,CONDITION_SKULL_RED) == FALSE then

doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))

doPlayerSendTextMessage(cid,22,"Sucessfully teleported!")

doRemoveItem(item.uid,1)

doCreatureSetSkull(cid, 0)

else

doPlayerSendTextMessage(cid,27,"Wait your skull for be teleport to your temple!")

end

return true

end

PsyMcKenzieP
01 de maio de 2013 às 00:12

Qual erro dá?

GearsG
01 de maio de 2013 às 00:15

Flw

 

function onUse(cid, item, frompos, item2, topos)
   if getCreatureCondition(cid,CONDITION_INFIGHT) then
       if getCreatureCondition(cid,CONDITION_SKULL_WHITE) == FALSE or if getCreatureCondition(cid,CONDITION_SKULL_BLACK) == FALSE or if getCreatureCondition(cid,CONDITION_SKULL_RED) == FALSE then
           doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
           doPlayerSendTextMessage(cid, 22, "Sucessfully teleported!")
           doRemoveItem(item.uid, 1)
           doCreatureSetSkull(cid, 0)
       else
           doPlayerSendTextMessage(cid, 27, "Wait your skull for be teleport to your temple!")
       end
       return true
       end      

flagoaF
01 de maio de 2013 às 00:32

Aqui está dando este erro no script do Gears:

 

 

[1/5/2013 0:27:37] [Error - LuaInterface::loadFile] data/actions/scripts/back_to_temple.lua:3: unexpected symbol near 'if'

[1/5/2013 0:27:37] [Error - Event::checkScript] Cannot load script (data/actions/scripts/back_to_temple.lua)

 

 

Já com o meu script dá este erro:

 

 

[1/5/2013 0:28:50] [Error - LuaInterface::loadFile] data/actions/scripts/back_to_temple.lua:14: 'end' expected (to close 'if' at line 3) near '<eof>'

[1/5/2013 0:28:50] [Error - Event::checkScript] Cannot load script (data/actions/scripts/back_to_temple.lua)

[1/5/2013 0:28:50] data/actions/scripts/back_to_temple.lua:14: 'end' expected (to close 'if' at line 3) near '<eof>'

 

 

Mas creio que o script do Gears esteja no caminho certo, mas ainda não funfou.

GearsG
01 de maio de 2013 às 00:49
function onUse(cid, item, frompos, item2, topos)
   if getCreatureCondition(cid,CONDITION_INFIGHT) then
       if getCreatureCondition(cid,CONDITION_SKULL_WHITE) == FALSE then
           if getCreatureCondition(cid,CONDITION_SKULL_BLACK) == FALSE then
               if getCreatureCondition(cid,CONDITION_SKULL_RED) == FALSE then
                   doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
                   doPlayerSendTextMessage(cid, 22, "Sucessfully teleported!")
                   doRemoveItem(item.uid, 1)
                   doCreatureSetSkull(cid, 0)
                   else
                   doPlayerSendTextMessage(cid, 27, "Wait your skull for be teleport to your temple!")
               end
               return true
           end             

flagoaF
01 de maio de 2013 às 00:52

Ta tenso rsrsrsrs... tmb to batendo cabeça, mas ta complicado! Ainda com erros.

 

 

[1/5/2013 0:48:47] [Error - LuaInterface::loadFile] data/actions/scripts/back_to_temple.lua:14: 'end' expected (to close 'if' at line 3) near '<eof>'

[1/5/2013 0:48:47] [Error - Event::checkScript] Cannot load script (data/actions/scripts/back_to_temple.lua)

[1/5/2013 0:48:47] data/actions/scripts/back_to_temple.lua:14: 'end' expected (to close 'if' at line 3) near '<eof>'

GearsG
01 de maio de 2013 às 01:41
function onUse(cid, item, frompos, item2, topos)
   if getCreatureCondition(cid,CONDITION_INFIGHT) then
       if getCreatureCondition(cid,CONDITION_SKULL_WHITE) == FALSE then
           if getCreatureCondition(cid,CONDITION_SKULL_BLACK) == FALSE then
               if getCreatureCondition(cid,CONDITION_SKULL_RED) == FALSE then
                   doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
                   doPlayerSendTextMessage(cid, 22, "Sucessfully teleported!")
                   doRemoveItem(item.uid, 1)
                   doCreatureSetSkull(cid, 0)
                   else
                   doPlayerSendTextMessage(cid, 27, "Wait your skull for be teleport to your temple!")
               end
               return true
           end
       end
   end
end

flagoaF
01 de maio de 2013 às 12:07

Agora não deu erro, mas ao clicar no item não desenvolve nenhuma ação, nem no jogo nem no servidor. No caso o id é 20327.