Ir para conteúdo

Featured Replies

Postado

Verifiquei que algum player usou o item rope e houve um erro no script na linha 10, mas não sei como arrumar, alguem pode me dar uma ajuda?

post-150155-0-75987900-1440447936_thumb.

 

rope.lua

local holeId = {

294, 369, 370, 383, 392, 408, 409, 410, 427, 428, 430, 462, 469, 470, 482,
484, 485, 489, 924, 3135, 3136, 7933, 7938, 8170, 8286, 8285, 8284, 8281,
8280, 8279, 8277, 8276, 8323, 8567, 8585, 8596, 8595, 8249, 8250, 8251,
8252, 8253, 8254, 8255, 8256, 8972, 9606, 9625, 13190, 14461, 19519, 21536
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
local tile = toPosition:getTile()
local ground = tile:getGround()
if ground and isInArray(ropeSpots, ground:getId()) or tile:getItemById(14435) then
Player(cid):teleportTo({x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, false)
return true
elseif isInArray(holeId, itemEx.itemid) then
toPosition.z = toPosition.z + 1
tile = toPosition:getTile()
if tile then
local thing = tile:getTopVisibleThing()
if thing:isItem() and thing:getType():isMovable() then
return thing:moveTo({x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1})
elseif thing:isCreature() and thing:isPlayer() then
return thing:teleportTo({x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1})
end
end
 
Player(cid):sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
return true
end
 
return false

end

 

Alguem pode me ajudar por favor?

Postado

Tente esse:

local spotId = {384, 418, 8278, 8592}


local holeId = {


294, 369, 370, 383, 392,


408, 409, 427, 428, 430,


462, 469, 470, 482, 484,


485, 489, 924, 3135, 3136,


7933, 7938, 8170, 8286, 8285,


8284, 8281, 8280, 8279, 8277,


8276, 8323, 8380, 8567, 8585,


8596, 8595, 8249, 8250, 8251,


8252, 8253, 8254, 8255, 8256,


8972, 9606, 9625
}



function onUse(cid, item, fromPosition, itemEx, toPosition)


if(toPosition.x == CONTAINER_POSITION) then


doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)


return true


end


local itemGround = getThingFromPos(toPosition)


if(isInArray(spotId, itemGround.itemid)) then


doTeleportThing(cid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, false)


elseif(isInArray(holeId, itemEx.itemid)) then


local hole = getThingFromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE})


if(hole.itemid > 0) then


doTeleportThing(hole.uid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z}, false)


else


doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)


end


else


return false


end




return true


end

Editado por Larissa Azhaurn (veja o histórico de edições)

  • 3 weeks later...
Postado

O tópico foi movido para a área correta, preste mais atenção da próxima vez!
Leia as regras do fórum: http://tibiaking.com/forum/topic/1281-regras-gerais/?p=7680

Este tópico foi movido:
De: "OTServScriptingGeral"
Para: "OTServSuporte OTServSuporte de Scripts"

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo