Postado Setembro 25, 2020 4 anos Não estou conseguindo usar ROPE no meu pé. Erro da distro: [25/9/2020 14:34:19] [Error - Action Interface] [25/9/2020 14:34:19] data/actions/scripts/tools/rope.lua:onUse [25/9/2020 14:34:19] Description: [25/9/2020 14:34:19] data/lib/050-function.lua:37: bad argument #1 to 'ipairs' (table expected, got number) [25/9/2020 14:34:19] stack traceback: [25/9/2020 14:34:19] [C]: in function 'ipairs' [25/9/2020 14:34:19] data/lib/050-function.lua:37: in function 'isInArray' [25/9/2020 14:34:19] data/actions/scripts/tools/rope.lua:13: in function <data/actions/scripts/tools/rope.lua:2> Script ROPE local holeId = {294, 369, 370, 383, 392, 408, 409, 427, 428, 430, 462, 469, 470, 482, 484, 485, 489, 924, 3135, 3136} function onUse(cid, item, fromPosition, itemEx, toPosition) local groundTile = getThingfromPos(toPosition) if groundTile.itemid == 384 or groundTile.itemid == 418 or groundTile.itemid == 8278 then doTeleportThing(cid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, FALSE) elseif isInArray(holeId, itemEx.itemid) == TRUE 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 doPlayerSendCancel(cid, "Sorry, not possible.") end elseif isInArray(5967, itemEx.itemid) == TRUE then doSetGameState(GAMESTATE_SHUTDOWN) else return FALSE end return TRUE end
Postado Setembro 27, 2020 4 anos Solução @Vorkhon Testa esse aqui function onUse(cid, item, fromPosition, itemEx, toPosition) local storageEx = 923501 local time = 1 ---- EXHAUST ------------------------------------------------------- if(getPlayerStorageValue(cid,storage) >= os.time()) then doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED) return TRUE end doPlayerSetStorageValue(cid, storage, os.time() + time) ---- -------- ------------------------------------------------------- if(toPosition.x == CONTAINER_POSITION) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) return true end toPosition.stackpos = STACKPOS_GROUND local itemGround = getThingFromPos(toPosition) if(isInArray(SPOTS, itemGround.itemid)) then doTeleportThing(cid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, false) return true elseif(isInArray(ROPABLE, 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 return true end return false end Contatos: Discord: Marvok#9855
Postado Setembro 27, 2020 4 anos Autor 20 horas atrás, Marvok disse: @Vorkhon Testa esse aqui function onUse(cid, item, fromPosition, itemEx, toPosition) local storageEx = 923501 local time = 1 ---- EXHAUST ------------------------------------------------------- if(getPlayerStorageValue(cid,storage) >= os.time()) then doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED) return TRUE end doPlayerSetStorageValue(cid, storage, os.time() + time) ---- -------- ------------------------------------------------------- if(toPosition.x == CONTAINER_POSITION) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) return true end toPosition.stackpos = STACKPOS_GROUND local itemGround = getThingFromPos(toPosition) if(isInArray(SPOTS, itemGround.itemid)) then doTeleportThing(cid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, false) return true elseif(isInArray(ROPABLE, 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 return true end return false end Funcionou amigo! Muito obrigado!
Postado Setembro 27, 2020 4 anos @Vorkhon marca como melhor resposta para fechar o tópico Contatos: Discord: Marvok#9855
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.