OSRS Plugin API
    Preparing search index...

    Function lineOfWalk

    • Returns whether it is possible to walk from the starting coordinate to the end coordinate. Returns false if not walkable or if the given coordinates are on different levels.

      Parameters

      Returns boolean

      function testWalkable(startingCoord, endCoord)
      local color = osrs.Colour.new(255, 255, 0, 100)
      osrs.ClientOp.highlightTileOn(endCoord:toBitPacked(), 6, true);
      if(osrs.Collision.lineOfWalk(startingCoord, endCoord)) then
      osrs.print("Can Walk to this tile")
      else
      osrs.print("Can't Walk to this tile")
      end
      end

      local playerCoord = osrs.ClientOp.coord()
      testWalkable(playerCoord, playerCoord:move(0,0,4))
      testWalkable(playerCoord, playerCoord:move(0,0,-2))